I’m writing some stress tests for a Spray server (1.0-M7) which is sending back some cookies, that I would like Gatling (1.4.7) to pass on subsequently (as it does). What I’m seeing is that Spray sends back the cookie values quoted, and then when Gatling attaches it to a subsequent request it is malformed because of the extra quotes. Something like this:
It looks like Spray has changed their implementation recently to not quote the values (https://github.com/spray/spray/pull/217) but it has not yet made it into a milestone release and we do not want to use a nightly build at this point.
Let me check, that’s probably AsyncHttpClient that doesn’t properly handle quoted cookie values.
Your workaround would probably work, but it might be better to get this fixed in the right place, in AHC. Hopefully, I’m a committer there too, so that might speed up things.
I’ve pushed a fix on AHC for your problem. The AHC release will probably be tomorrow, but I’ve deployed a SNAPSHOT in our repository: http://repository.excilys.com/
Could you give it a try? Version is 1.7.14.custom.
I’ve just tested the snapshot but am getting an IllegalAccessError. It looks like the Gatling CookieJar needs access to setPorts() in AHC, but that is now a private method. This is the stack trace I get:
Uncaught error from thread [GatlingSystem-akka.actor.default-dispatcher-8] shutting down JVM since ‘akka.jvm-exit-on-fatal-error’ is enabled for ActorSystem[GatlingSystem]
java.lang.IllegalAccessError: tried to access method com.ning.http.client.Cookie.setPorts(Ljava/lang/Iterable;)V from class com.excilys.ebi.gatling.http.cookie.CookieJar$$anonfun$1
at com.excilys.ebi.gatling.http.cookie.CookieJar$$anonfun$1.apply(CookieJar.scala:77)
at com.excilys.ebi.gatling.http.cookie.CookieJar$$anonfun$1.apply(CookieJar.scala:71)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
at scala.collection.immutable.List.map(List.scala:76)
at com.excilys.ebi.gatling.http.cookie.CookieJar.add(CookieJar.scala:71)
at com.excilys.ebi.gatling.http.cookie.CookieJar$.apply(CookieJar.scala:39)
at com.excilys.ebi.gatling.http.cookie.CookieHandling$.storeCookies(CookieHandling.scala:39)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor.com$excilys$ebi$gatling$http$ahc$GatlingAsyncHandlerActor$$processResponse(GatlingAsyncHandlerActor.scala:200)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor$$anonfun$receive$1.apply(GatlingAsyncHandlerActor.scala:108)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor$$anonfun$receive$1.apply(GatlingAsyncHandlerActor.scala:84)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor.apply(GatlingAsyncHandlerActor.scala:70)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197)
at akka.dispatch.Mailbox.run(Mailbox.scala:179)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516)
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479)
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)