Make possible to have bigger scenarios #345

Closed
cstamas opened this Issue Jan 11, 2012 · 11 comments

Comments

Projects
None yet
3 participants

cstamas commented Jan 11, 2012

Probably this isn't the main use case but...

I recorded a scenario (using Gatling Recorder) which was actually a trivial Maven build to record artifact requests ;)

I was unable to execute that scenario due to various exceptions (like those below). To be able to execute scenario, I had to literally mutilate it to a few liners (ended up with less then a 10% of original scenario), not presenting anymore what it initially did.

Again, it's maybe my starting point wrong, but if there is some scenario size limit, it should be noted somewhere to prevent people doing foolish things like i tried.


Exception in thread "main" java.lang.StackOverflowError
    at scala.reflect.generic.Trees$Traverser.traverse(Trees.scala:454)
    at scala.tools.nsc.ast.Trees$Traverser.traverse(Trees.scala:920)
    at scala.tools.nsc.interpreter.MemberHandlers$ImportVarsTraverser.traverse(MemberHandlers.scala:43)
...


Exception in thread "main" java.lang.StackOverflowError
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3896)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:624)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4104)
Contributor

rsertelon commented Jan 11, 2012

Hi @cstamas!

First thanks for your feedback.

The problem you encounter will be corrected in version 1.1.0. The problem comes from the Scala Interpreter, when it tries to interpret a long simulation script, it encounters a stack overflow.

The problem has been fixed in commit a6bf53f.

As a temporary solution, you can either increase the stack size (-Xss) in the gatling.sh/.bat file, or build the master branch.

We could also release a bug fix (1.0.2) to solve this problem :-)

Owner

slandelle commented Jan 11, 2012

Hi (and congrats for being the first issue reporter ;) )

Yep, I decided to fix this in master by getting rid of the Interpreter and compile the txt scenarios just the same way as scala ones. I didn't expected to be blocking though. My bad...

By the time we release a 1.0.2, you can :

  • either re-record it with the recorder and select the scala format
  • or better, simply convert your existing scenario into a scala one (change the extension to .scala) :

import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.script.GatlingSimulation

class Simulation extends GatlingSimulation {

XXXXXXXXXXXX <-- the content of your current scenario

}

Let me know if this unblock the situation.

cstamas commented Jan 11, 2012

hi there! Thanks for ... ahem, thanks for warm words! :D

I decided to build the current master, but it still failed with same exceptions to execute my script...
Very same thing happens when I convert it to scala as written above.

Owner

slandelle commented Jan 11, 2012

Strange, could you send me your scenario or post it as a gist, please?

cstamas commented Jan 11, 2012

Um, a mment, not the same, similar better:


 - maven-build-central
     [2] default

Simulation #: 
2
Simulation started...
Exception in thread "main" java.lang.StackOverflowError
    at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:170)
    at scala.tools.nsc.typechecker.Contexts$Context.make0(Contexts.scala:228)
    at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:236)
    at scala.tools.nsc.typechecker.Contexts$Context.make(Contexts.scala:239)
    at scala.tools.nsc.typechecker.Contexts$Context.makeSilent(Contexts.scala:242)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:619)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4104)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4350)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4356)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4144)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:624)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4104)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4350)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4356)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4144)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedApply$1$1.apply(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:624)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:3353)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4104)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4271)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4350)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:4356)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4144)

cstamas commented Jan 11, 2012

@slandelle scenario mailed to you

Owner

slandelle commented Jan 11, 2012

Wow, what a nice scenario!!! ;)
You have 232 requests, all in one single chain that indeed explodes the stack size limit.

As it is now, your scenario can be processed with -Xss=3M
The proper way of decreasing the required stack size is to split your scenario into multiple chains :

val chain1 = chain.pause(0, 100, MILLISECONDS)
.exec(
http("request_44")
.get("/nexus/content/groups/public/org/apache/maven/maven/2.0.6/maven-2.0.6.pom")
.headers(headers_44)
)....

val scn = scenario("Scenario name").insertChain(chain1).insertChain(chain2)...

By splitting your scenario into 4 chains, I was able to run it with -Xss=1M

cstamas commented Jan 11, 2012

Maven does download the internet, ya know.... but that's why Nexus is here to cut the bills :D

Thanks for the tips!

Owner

slandelle commented Jan 11, 2012

Here is what I plan to do :

  • increase -Xss after a we have run some tests to check the impact
  • modify the recorder so that it automatically split a scenario into chains of 50 requests max

Anyway, we encourage people to modularize their scenarios into readable/reusable chains that can be declared in dedicated objects located into the suite directory (maven-build-central in your case).
see wiki page

Contributor

rsertelon commented Jan 11, 2012

Added your issue and its solution to our FAQ :-)

Contributor

rsertelon commented Jan 12, 2012

Added documentation in this wiki page

rsertelon closed this Jan 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment