Error:
16:21:03.289 [ERROR] i.g.c.s.Session - exitLoop called but stack head List(GroupBlock(List(Warmup, Auth.login),1517271658919,317,OK), GroupBlock(List(Warmup),1517271658919,317,OK)) isn’t a Loop Block, please report.
Note: The error happens at the end of the asLongAs loop. Note. When this error happens … other asLongAs loops further in the chainblock are ignored and do not work.
Any advice?
Code
I worked around this with trymax… but I am curious if this is a bug or not.
def login = group("Auth.login") {
feed(usersCsv.circular)
.exec { session =>
session.set("loop",0)
}
.tryMax(200) {
exec { session =>
session.set("loop",session.get("loop").as[Int] +1)
}
.pause(_.get("loop").as[Int] seconds)
.exec(_.set("jama-csrf-token", "jama-csrf-token"))
.exec(addCookie(Cookie("GatlingFakeCSRFHeader", "GatlingFakeCSRFHeader")))
.exec(http("Login Redirect")
.post("/j_acegi_security_check")
.disableFollowRedirect
.formParam("j_username", _.get("currentUserName").as[String])
.formParam("j_password", _.get("currentUserPassword").as[String])
.formParam("submit", "Login")
.check(status.is(302))
.check(currentLocationRegex("^.*login.req.*$").count.is(0)) // Check that we did NOT redirect to the login page
.check(headerRegex("Set-Cookie", "jama-csrf-token=(.*); Domain").optional.saveAs("jama-csrf-token"))
)
.pause(1 second)
.exec(http("Login")
.get("/rest/latest/itemtypes")
.check(status.is(200))
.check(jsonPath("$..data[?(@.typeKey=='ATT')].id").saveAs("itemtypeid_attachment"))
.check(jsonPath("$..data[?(@.typeKey=='CMP')].id").saveAs("itemtypeid_component"))
.check(jsonPath("$..data[?(@.typeKey=='CORE')].id").saveAs("itemtypeid_core"))
.check(jsonPath("$..data[?(@.typeKey=='FLD')].id").saveAs("itemtypeid_folder"))
.check(jsonPath("$..data[?(@.typeKey=='TC')].id").saveAs("itemtypeid_testcase"))
.check(jsonPath("$..data[?(@.typeKey=='TSTPL')].id").saveAs("itemtypeid_testplan"))
.check(jsonPath("$..data[?(@.typeKey=='TSTCY')].id").saveAs("itemtypeid_testcycle"))
.check(jsonPath("$..data[?(@.typeKey=='TSTRN')].id").saveAs("itemtypeid_testrun"))
.check(jsonPath("$..data[?(@.typeKey=='TXT')].id").saveAs("itemtypeid_text"))
.check(jsonPath("$..data[?(@.typeKey=='SET')].id").saveAs("itemtypeid_set"))
.check(status.saveAs("loginRetCode"))
)
.pause(1 second)
}
}
Would need a simple reproducer that I can run on my side to reproduce your problem and be able to investigate.