How do exitHereIfFailed should work?

Hi all,

I’ve observed some surprising behaviour of exitHereIfFailed. Can you please help me figure it out, if I’m using it right?

We’ve got some test, on which we send some JMS message with some task to be processed, and then loop quering some services via http to check, if processing goes ok. Our code looks more-less like that (sorry, I cannot copy exact test, due to some company policies)

val processItemUpdate =
feed(someFeeder)
.exec(someHttpCheckProbablyNotInteresting)
.exec(jms(“item update”).reqreply.queue(“item_update_queue”).constructMessage.check(checkMessageType(“updateWentOkMessage”)))
.exitHereIfFailed
.asLongAs(checkThatWentOk){
.exec(httpCheckThatOk).doIf(checkThatWentOk).pause(2)
}

where checkMessageType is

def checkMessageType(requiredMsgType: String) = simpleCheck {
(m:Message) => {
m match {
case textMessage:TextMesage => textMessage.getStringProperty(MSG_TYPE_PROPERTY) == requiredMsgType
case _ => false
}
}
}

If JMS service returns proper reply, whole test works fine. The problem is that when JMS service replies with error message, we know that the test has failed, and we would like to break the test on exitHereIfFailed. But it doesn’t seem to work this way: test carries on into asLongAs() instruction and loops. If we ctrl-c the test, we can see results which looks like that:

waiting: 0 / running: 10 / done:0

JMS support wasn’t properly working with exitHereWithFailed: https://github.com/excilys/gatling/issues/1849

Fixed, thanks for reporting!

Wow, that was quick! Thank you!

Best regards,
Mateusz

Please wait a few minutes, there’s a failing test.

Fixed now, build under way.