I have following scenario:
val scn = scenario("WebSocket")
.exec(ws("Connect WS").open(""))
.exec(ws("Sending query")
.sendText(session => query())
.check(wsAwait.within(300).until(1).regex(""".*"status":"Finished".*""").saveAs("SiftOutput"))
)
.exec{ session =>
session("SiftOutput").asOption[String].foreach(println)
session
}
.exec(ws("Close WS").close)
setUp(scn.inject(atOnceUsers(5)).protocols(httpConf))
During execution 1st query executes successfully, but rest 4 are times out. That’s expected failure.
The problem, is that this Gatling method couldn’t process closed connection:
.check(wsAwait.within(300).until(1).regex(""".*"status":"Finished".*""").saveAs("SiftOutput"))
So, I expect, that it would wait up to 300 seconds. And if connection is not getting closed, that’s exactly, how it works.
But, if connection get closed, then this method never finish execution, and keep running for hours.
Here is what I see in the console after few hours:
2015-08-20 08:38:32 56467s elapsed
---- WebSocket -----------------------------------------------------------------
[##############------------------------------------------------------------] 20%
waiting: 0 / active: 4 / done:1
---- Requests ------------------------------------------------------------------
Global (OK=12 KO=4 )
Connect WS (OK=5 KO=0 )
Sending query (OK=5 KO=0 )
Sending query Check (OK=1 KO=4 )
Close WS (OK=1 KO=0 )
---- Errors --------------------------------------------------------------------
Websocket ‘gatling.http.webSocket’ was unexpectedly closed wit 4 (100.0%)
h status 1006 and message Connection was closed abnormally (th…
So, this seems like a bug in Gatling method. Or am I not understand something about the .check(wsAwait.within(300) method?