Websocket test ok with browser but crashes with Gatling

390 views
Skip to first unread message

Sergi González

unread,
Dec 3, 2015, 10:41:19 AM12/3/15
to Gatling User Group
Hi guys,

I'm currently developing a Play Framework application with websockets and I want to do some load test with Gatling.

When I test my application opening a webserver from Chrome Dev tools everything looks ok:

enter image description here

But when I try to do the same with Gatling I get "Invalid status code 0". I think there is no problem without Gatling ... I think the problem is with Play but I'm not sure... I have tested my Gatling test with http://www.websocket.org/echo.html and it works.

My Gatling test:

class BasicTest extends Simulation {

  val httpConf = http
    .baseURL("http://localhost:9000")
    .wsMaxReconnects(1)
    .header("Sec-WebSocket-Version", "13")
    .header("Sec-WebSocket-Extensions" , "permessage-deflate client_max_window_bits")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .acceptEncodingHeader("gzip, deflate")
    .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36")
    .wsBaseURL("ws://localhost:9000")
  
  val scn = scenario("WebSocket")
    .exec(ws("Connect WS").open("/socket"))
    .pause(10)
    .exec(ws("Close WS").close)

  setUp(scn.inject(rampUsers(1) over 1.seconds)).protocols(httpConf)
}

I get a similar error using wscat

enter image description here

I'm new in websockets stuff... so, any idea about what's going on will be appreciated.

Regards,
Sergi


Stéphane LANDELLE

unread,
Dec 3, 2015, 10:50:27 AM12/3/15
to gat...@googlegroups.com
Same answer as on SOF: http://stackoverflow.com/questions/34061078/websocket-works-in-browser-but-hangs-from-other-clients

Sample plz

But what's sure is that Gatling doesn't support WebSocket Extensions atm.

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sergi González

unread,
Dec 3, 2015, 11:05:55 AM12/3/15
to Gatling User Group
Hi, 

The code is not public...

I'm testing now against https://github.com/JAVEO/clustered-chat#master which is pretty the same than my application and I get same results... "Invalid Status Code 0"


I don't know if is something about my machine (mac os) but i have created another ws server with wscat (wscat -l 8080 -p 13) and pointing to this, my Gatling test works.

Sergi González

unread,
Dec 3, 2015, 11:23:39 AM12/3/15
to Gatling User Group
Ok,

Now it works. Play by default works in port 9000 and I had this port binded with php-fpm.... But I still don't understand why Play not crashes when trying to bind the application to an already binded port. 

Thanks guys.


El jueves, 3 de diciembre de 2015, 16:41:19 (UTC+1), Sergi González escribió:

Stéphane LANDELLE

unread,
Dec 4, 2015, 7:45:37 AM12/4/15
to gat...@googlegroups.com
lol

Thanks for your feedback

Stéphane Landelle
GatlingCorp CEO


Reply all
Reply to author
Forward
0 new messages