Re: [Gatling List] Issues with simple loop scenario

696 views
Skip to first unread message

Stéphane LANDELLE

unread,
May 29, 2015, 7:37:20 PM5/29/15
to gat...@googlegroups.com
That's a race condition that happens when using maxDuration or throttling.
It's annoying, but it doesn't really hurt.
It's already fixed in master.

Stéphane Landelle
Lead developer


On Fri, May 29, 2015 at 8:50 PM, Jesus Morones <jmor...@gmail.com> wrote:
I'm trying to create a simple scenario to loop forever and every user continuously execute a GET request. 

package load.simulations

import load.feeder.randomFeeder
import load.scenarios.search
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._

class SearchSimulation extends Simulation {

val basePath = System.getProperty("basePath", "http://10.172.105.104:8181/services")
val duration: Int = Integer.getInteger("duration", 5)
val users: Int = Integer.getInteger("users", 10)
val rampUp: Int = Integer.getInteger("rampUp", 1)
val rps: Int = Integer.getInteger("rps", 40)

println(s"SearchSimulation(basePath=$basePath, duration=$duration, users=$users, rampUp=$rampUp, req/s=$rps)")

val httpConf = http
.baseURL(basePath)
.acceptHeader("application/json")

val scn = scenario("Search requests").forever("loopCount"){
feed(csv("search_data.csv").random)
.feed(randomFeeder.feeder)
.exec(search.queryByContext)
}

setUp(scn.inject(atOnceUsers(users))
.protocols(httpConf))
.maxDuration(duration minutes)
.throttle(
reachRps(rps) in (rampUp minutes),
holdFor(duration minutes)
)
}

What I get is users active for the duration of the test (defined my maxDuration) and only a few requests made. 

================================================================================
2015-05-29 14:43:53                                         275s elapsed
---- Search requests -----------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 10     / done:0     
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=6      KO=0     )
> SEARCH query by context                                  (OK=6      KO=0     )
================================================================================

Then I get this exception at the end of the test for every user:

Simulation finished
[ERROR] [05/29/2015 14:44:18.448] [GatlingSystem-akka.actor.default-dispatcher-10] [ActorSystem(GatlingSystem)] exception while executing timer task
java.lang.UnsupportedOperationException: AsyncHandlerActor pool hasn't been started
at io.gatling.http.ahc.AsyncHandlerActor$.instance(AsyncHandlerActor.scala:58)
at io.gatling.http.ahc.AsyncHandler.sendOnThrowable(AsyncHandler.scala:123)
at io.gatling.http.ahc.AsyncHandler.onThrowable(AsyncHandler.scala:108)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:89)
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:506)
at io.gatling.http.ahc.HttpEngine$$anonfun$startHttpTransaction$1.apply$mcV$sp(HttpEngine.scala:283)
at akka.actor.Scheduler$$anon$7.run(Scheduler.scala:117)
at akka.actor.LightArrayRevolverScheduler$TaskHolder.run(Scheduler.scala:476)
at akka.actor.LightArrayRevolverScheduler$$anonfun$close$1.apply(Scheduler.scala:282)
at akka.actor.LightArrayRevolverScheduler$$anonfun$close$1.apply(Scheduler.scala:281)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at akka.actor.LightArrayRevolverScheduler.close(Scheduler.scala:280)
at akka.actor.ActorSystemImpl.stopScheduler(ActorSystem.scala:689)
at akka.actor.ActorSystemImpl$$anonfun$liftedTree2$1$1.apply$mcV$sp(ActorSystem.scala:618)
at akka.actor.ActorSystemImpl$$anonfun$liftedTree2$1$1.apply(ActorSystem.scala:618)
at akka.actor.ActorSystemImpl$$anonfun$liftedTree2$1$1.apply(ActorSystem.scala:618)
at akka.actor.ActorSystemImpl$$anon$3.run(ActorSystem.scala:642)
at akka.actor.ActorSystemImpl$TerminationCallbacks$$anonfun$run$1.runNext$1(ActorSystem.scala:809)
at akka.actor.ActorSystemImpl$TerminationCallbacks$$anonfun$run$1.apply$mcV$sp(ActorSystem.scala:812)
at akka.actor.ActorSystemImpl$TerminationCallbacks$$anonfun$run$1.apply(ActorSystem.scala:805)
at akka.actor.ActorSystemImpl$TerminationCallbacks$$anonfun$run$1.apply(ActorSystem.scala:805)
at akka.util.ReentrantGuard.withGuard(LockUtil.scala:15)
at akka.actor.ActorSystemImpl$TerminationCallbacks.run(ActorSystem.scala:805)
at akka.actor.ActorSystemImpl$$anonfun$terminationCallbacks$1.apply(ActorSystem.scala:639)
at akka.actor.ActorSystemImpl$$anonfun$terminationCallbacks$1.apply(ActorSystem.scala:639)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:90)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:88)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:88)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:88)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:401)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)



================================================================================
---- Global Information --------------------------------------------------------
> request count                                          6 (OK=6      KO=0     )
> min response time                                    101 (OK=101    KO=-     )
> max response time                                    306 (OK=306    KO=-     )
> mean response time                                   197 (OK=197    KO=-     )
> std deviation                                         65 (OK=65     KO=-     )
> response time 50th percentile                        195 (OK=195    KO=-     )
> response time 75th percentile                        229 (OK=229    KO=-     )
> mean requests/sec                                   0.02 (OK=0.02   KO=-     )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                             6 (100%)
> 800 ms < t < 1200 ms                                   0 (  0%)
> t > 1200 ms                                            0 (  0%)
> failed                                                 0 (  0%)
================================================================================


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

Jesus Morones

unread,
Jun 1, 2015, 10:49:50 AM6/1/15
to gat...@googlegroups.com
Thanks for the reply.

I figured out it was something like that. 
I guess my issue is with throttle. In my example I had it set to the whole simulation and it would only generate a few request (no looping even though there is a loop there). Once I applied the throttle to the scenario instead of the whole simulation. It works as expected. Can you explain why is that? I'm probably missing something. I'm used to Java but Scala is completely foreign to me.

Stéphane LANDELLE

unread,
Jun 1, 2015, 10:52:35 AM6/1/15
to gat...@googlegroups.com
That's a known bug: https://github.com/gatling/gatling/issues/2717 :)
It's been already fixed, but not released yet.

Stéphane Landelle
Lead developer


Reply all
Reply to author
Forward
0 new messages