当我使用 jsonPath 时,Gatling 冻结了
Gatling is freezing when I use jsonPath
我有 Gatling 版本 3.0.0-RC4。
我有以下加特林代码
object Signup {
val feeder = csv("phones.csv").circular
var signup = tryMax(2) {
exec(
http("Get details")
.get("/v2/dummy/2")
.check(status.is(200))
)
.feed(feeder)
.exec(
http("Signup")
.post("/v2/user/customer")
.header(HttpHeaderNames.ContentType, HttpHeaderValues.ApplicationJson)
.header(HttpHeaderNames.Accept, HttpHeaderValues.ApplicationJson)
.header("Set-Cookie", "id=2")
.body(StringBody("""{
"email": "rm@gmail.com",
"phone_number": "${phoneNumber}",
"first_name": "Rishi",
"last_name": "Mukherjee",
"pin": "1234",
}""")).asJson
.check(
jsonPath("$.otp_data.otp_uuid").saveAs("lastResponse")))
}.exitHereIfFailed
}
在行 jsonPath("$.otp_data.otp_uuid").saveAs("OTPUUID")
中,如果我将其替换为 status.is(200)
,代码 运行 就可以了。但是,使用这一行,在 运行 运行程序时,它会冻结并继续显示以下内容
================================================================================
2018-10-12 17:36:11 5s elapsed
---- Requests ------------------------------------------------------------------
> Global (OK=1 KO=0 )
> Get details (OK=1 KO=0 )
---- Signup -------------------------------------------------------------
[--------------------------------------------------------------------------] 0%
waiting: 0 / active: 1 / done: 0
================================================================================
问题是,我没有收到任何错误或任何有助于调试的信息。事实上,当我 运行 包含的示例 AdvancedSimulationStep03.scala
时,也会发生这种情况。可能是什么问题或者我可能遗漏了什么?
所以,我有 JDK 11。文档说我应该有 JDK 8。切换到 JDK 8,它得到修复。
希望能帮助遇到困难的其他人。
我有 Gatling 版本 3.0.0-RC4。
我有以下加特林代码
object Signup {
val feeder = csv("phones.csv").circular
var signup = tryMax(2) {
exec(
http("Get details")
.get("/v2/dummy/2")
.check(status.is(200))
)
.feed(feeder)
.exec(
http("Signup")
.post("/v2/user/customer")
.header(HttpHeaderNames.ContentType, HttpHeaderValues.ApplicationJson)
.header(HttpHeaderNames.Accept, HttpHeaderValues.ApplicationJson)
.header("Set-Cookie", "id=2")
.body(StringBody("""{
"email": "rm@gmail.com",
"phone_number": "${phoneNumber}",
"first_name": "Rishi",
"last_name": "Mukherjee",
"pin": "1234",
}""")).asJson
.check(
jsonPath("$.otp_data.otp_uuid").saveAs("lastResponse")))
}.exitHereIfFailed
}
在行 jsonPath("$.otp_data.otp_uuid").saveAs("OTPUUID")
中,如果我将其替换为 status.is(200)
,代码 运行 就可以了。但是,使用这一行,在 运行 运行程序时,它会冻结并继续显示以下内容
================================================================================
2018-10-12 17:36:11 5s elapsed
---- Requests ------------------------------------------------------------------
> Global (OK=1 KO=0 )
> Get details (OK=1 KO=0 )
---- Signup -------------------------------------------------------------
[--------------------------------------------------------------------------] 0%
waiting: 0 / active: 1 / done: 0
================================================================================
问题是,我没有收到任何错误或任何有助于调试的信息。事实上,当我 运行 包含的示例 AdvancedSimulationStep03.scala
时,也会发生这种情况。可能是什么问题或者我可能遗漏了什么?
所以,我有 JDK 11。文档说我应该有 JDK 8。切换到 JDK 8,它得到修复。
希望能帮助遇到困难的其他人。