tryMax question

Hello.

I’m attempting to use tryMax but it seems as though it’s executing the number of times I’ve specified regardless if the action succeeds or not. A sample of what I have right now is

val scn = scenario(“Scenario”)
.feed(csv(“fake_users.csv”))
.exec(Action.createAccount)
.tryMax(3, “loop”) {
exec(
Action.fetchJson
)
}

So if I have 50 fake accounts in the csv file, I create 50 accounts but it will fetchJson 150 times (all with an OK status). Is this the expected behavior and I misinterpreted the documentation?

I’m using gatling 2.0.0 snapshot

Thanks!

Hi Joseph,

Fixed, thanks for reporting!
https://github.com/excilys/gatling/issues/1988

Oh, awesome! Glad to (inadvertently) help :slight_smile:

Hi, I was trying to use the “tryMax”, in the Gatling 2.0.0-RC3 , but this problem, persist.
My code is:
val scn = scenario(“Insertions”) // Cria o database
.feed(feederConfig)
.exec(http(“createDB”)
.post("/v1/databases")
.body(StringBody("""{ “database_name” : “${database}” }""")).asJSON
.check(bodyString.saveAs(“existDB”))
).doIf(session => {session(“existDB”).as[String].contains(“database_name already taken”) || session.status.toString().equals(“OK”)}) {
exec(http(“importLayer”) // Começa a importar o layer
.post("/v1/imports")
.body(StringBody("""{ “database”:"${database}", “url”:"${layer-url}", “collection_name”:"${layer}", “geocode”: {“name”: “ovi”} }""")).asJSON
.check(jsonPath("$.id").saveAs(“layerID”))
).doIf(session => {!session(“layerID”).as[String].isEmpty()}) {
pause(1)
.tryMax(15) { // Começa a verificar se a inserção concluiu
pause(12)
.exec(http(“is_finished”)
.get("/v1/imports/${layerID}")
.check(jsonPath("$.stage").in(List(“finished”, “error”)))
)
}

}
}

The request “is_finished” is executed even when the “check” pass. The final result is:

Hi I was trying to use “tryMax” in Gatling 2.0.0-RC3 version. But the problem persist. It continue looping in the tryMax even when the check pass.
This is my cenario code:

val scn = scenario(“Insertions”) // Cria o database
.feed(feederConfig)
.exec(http(“createDB”)
.post("/v1/databases")
.body(StringBody("""{ “database_name” : “${database}” }""")).asJSON
.check(bodyString.saveAs(“existDB”))
).doIf(session => {session(“existDB”).as[String].contains(“database_name already taken”) || session.status.toString().equals(“OK”)}) {
exec(http(“importLayer”) // Começa a importar o layer
.post("/v1/imports")
.body(StringBody("""{ “database”:"${database}", “url”:"${layer-url}", “collection_name”:"${layer}", “geocode”: {“name”: “ovi”} }""")).asJSON
.check(jsonPath("$.id").saveAs(“layerID”))
).doIf(session => {!session(“layerID”).as[String].isEmpty()}) {
pause(1)
.tryMax(15) { // Começa a verificar se a inserção concluiu
pause(12)
.exec(http(“is_finished”)
.get("/v1/imports/${layerID}")
.check(jsonPath("$.stage").in(List(“finished”, “error”)))
)
}

}
}

And, this is the final console report:

I can’t reproduce. Are you sure you run RC3?

I think yes. Because I have download the gatling today. Have any manner to check this??

We’ve released RC4 since.
How did you download it? maven? bundle?