Atmosphere long polling

426 views
Skip to first unread message

James Bartlett

unread,
Aug 29, 2014, 5:53:49 AM8/29/14
to gat...@googlegroups.com
Hi,

This is the usual "I'm doing something without understanding it at all" post, so apologies up front.

I've been writing some performance tests with Gatling and until now it's all gone well. However, I'm trying to test a page with some sort of ajax request - and the 'proceed' button (the element I need to click to proceed in the app) is only enabled once this request has finished.

The test times out when trying to replicate the request, even though it's almost instant on the actual page. The Gatling recorder also gives up at this point.

The bit that I _think_ is causing the problem:

    emptyChain.execWithDefaults(
      http("Continue Atmosphere")
        .get("<URI>")
        .headers(continueHeaders)
        .queryParam("""X-Atmosphere-Transport""", """long-polling""")
        .queryParam("""X-Atmosphere-Framework""", """2.1.4-javascript""")
        .queryParam("""X-Atmosphere-TrackMessageSize""", """true""")
        .queryParam("""X-atmo-protocol""", """true""")
        .queryParam("""X-Atmosphere-tracking-id""", session=>{session}.getAttribute("trackingId").toString)
        .queryParam("""X-Cache-Date""", """0""")
        .queryParam("""_""", """2""")
    ).exec( session => {
      session
    })


where execWIthDefaults is:

  def execWithDefaults(request: GetHttpRequestBuilder): ChainBuilder = {
    builder
      .exec(
        request
          .basicAuth(<username>, <password>)
          .check(status.is(200))
      )
  }

And "trackingId" is captured in a previous regex.

Output from the run:

10:08:03.596 [INFO ] c.e.e.g.h.a.HttpRequestAction - Sending Request 'Continue Atmosphere': Scenario 'standard', UserId #1

10:09:03.617 [WARN ] c.e.e.g.h.a.GatlingAsyncHandler - Request 'Continue Atmosphere' failed

java.util.concurrent.TimeoutException: Request timeout of 60000 ms

at com.ning.http.client.providers.netty.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:43) [async-http-client-1.8.3.jar:na]

at com.ning.http.client.providers.netty.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:41) [async-http-client-1.8.3.jar:na]

at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:546) [netty-3.9.0.Final.jar:na]

at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:446) [netty-3.9.0.Final.jar:na]

at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:395) [netty-3.9.0.Final.jar:na]

at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.9.0.Final.jar:na]

at java.lang.Thread.run(Thread.java:745) [na:1.7.0_55]

10:09:03.620 [WARN ] c.e.e.g.h.a.GatlingAsyncHandlerActor - Request 'Continue Atmosphere' failed : Request timeout of 60000 ms

10:09:03.621 [TRACE] c.e.e.g.h.a.GatlingAsyncHandlerActor - 

>>>>>>>>>>>>>>>>>>>>>>>>>>

Request:

Continue Atmosphere: KO Request timeout of 60000 ms

=========================

Session:

scenarioName='standard' userId='1' data='Map(trackingId -> <trackingId>, gatling.core.timer.69d9db0a-6082-48e9-93f8-a34ba0d20dd4 -> 1409303269635, gatling.core.timeShift -> 105, gatling.http.lastModified -> Map(http://127.0.0.1:8080/<rest of URL> -> Fri, 29 Aug 2014 09:07:49 GMT), gatling.http.referer -> http://127.0.0.1:8080/<rest of URL>?X-Atmosphere-Framework=2.1.4-javascript&X-Atmosphere-TrackMessageSize=true&X-Atmosphere-Transport=long-polling&X-Atmosphere-tracking-id=f863d99a-d97e-48a1-9063-8f793d965ef7&X-atmo-protocol=true&_=2&X-Cache-Date=0, gatling.http.cookies -> CookieJar(Map(CookieKey(sessionproxyfilter_sessionid,127.0.0.1,/) -> StoredCookie(SessionProxyFilter_SessionId=c0f410a8-0c6f-4737-bc7e-9009da2adfde; domain=127.0.0.1; path=/,false,false,1409303269694))), 69d9db0a-6082-48e9-93f8-a34ba0d20dd4 -> 0)'

=========================

HTTP request:

GET http://127.0.0.1:8080/<rest of URL>?X-Atmosphere-Framework=2.1.4-javascript&X-Atmosphere-TrackMessageSize=true&X-Atmosphere-Transport=long-polling&X-Atmosphere-tracking-id=f863d99a-d97e-48a1-9063-8f793d965ef7&X-atmo-protocol=true&_=2&X-Cache-Date=0

headers=

Referer: http://127.0.0.1:8080/<rest of URL>?X-Atmosphere-Framework=2.1.4-javascript&X-Atmosphere-TrackMessageSize=true&X-Atmosphere-Transport=long-polling&X-Atmosphere-tracking-id=0&X-atmo-protocol=true&_=1&X-Cache-Date=0

Accept-Language: en,en-US;q=0.8

Connection: keep-alive

Accept-Encoding: gzip,deflate,sdch

Accept: */*

cookies=

SessionProxyFilter_SessionId=c0f410a8-0c6f-4737-bc7e-9009da2adfde; domain=127.0.0.1; path=/

=========================

HTTP response:

status=

200 OK

headers= 

Transfer-Encoding: chunked

X-Atmosphere-tracking-id: f863d99a-d97e-48a1-9063-8f793d965ef7

Date: Fri, 29 Aug 2014 09:08:03 GMT

Server: Apache-Coyote/1.1



<<<<<<<<<<<<<<<<<<<<<<<<<

================================================================================

2014-08-29 10:09:03                                                  73s elapsed

---- standard --------------------------------------------------------------

Users  : [-----------------------------------------------------------------]  0%

          waiting:0     / running:1     / done:0    

---- Requests ------------------------------------------------------------------

> Global                                                     OK=7      KO=1     

> Start empty enquiry                                        OK=1      KO=0     

> Start empty enquiry Redirect 1                             OK=1      KO=0     

> Start default enquiry                                      OK=1      KO=0     

> Start default enquiry Redirect 1                           OK=1      KO=0     

> Add default term product                                   OK=1      KO=0     

> Get available products                                     OK=1      KO=0     

> Initialize Atmosphere                                      OK=1      KO=0     

> Continue Atmosphere                                        OK=0      KO=1     

================================================================================

Stéphane Landelle

unread,
Aug 29, 2014, 6:00:51 AM8/29/14
to gat...@googlegroups.com
Hi,

Jean-François hates me for that, but I still don't know much about Atmo...

We're in RC phase for Gatling 2. Have you tried with latest snapshot?

Is there any way you can share a reproducer, please?

Cheers,




--
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.

James Bartlett

unread,
Aug 29, 2014, 7:26:20 AM8/29/14
to gat...@googlegroups.com
I haven't yet tried v2 - I'll give that a go. Thanks for replying so quickly!
Reply all
Reply to author
Forward
0 new messages