Reputation: 3673
I have following scenario
.tryMax(10) {
pause(200 millis)
exec(
http("monitor status")
.get("/${orderId}")
.headers(sentHeaders)
.check(status is 200)
.check(jsonPath("$.status").is("SUCCESSFUL"))
)
}
// next request
I expect this to call my endpoint up to 10 times until the condition status=SUCCESSFUL
is met.
It does this correctly and only executes the next request after the condition is met. However, the test result still reports it as a failure.
---- Errors --------------------------------------------------------------------
> jsonPath($.status).find.is(SUCCESSFUL), but actu 992 (100.0%)
ally found ACCEPTED
Why is it reporting the request inside the tryMax
as an error?
Upvotes: 3
Views: 992
Reputation: 6623
That's the expected behavior for tryMax
.
Use an asLongAs
loop and a non failing check where you would save the extracted value to be used for the loop condition.
Upvotes: 1