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
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?
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”)))
)
}