Waiting for a simulation to complete, then executing a second simulation.

Hi,

I have simulation that will create various artifacts without necessarily deleting them. I want to execute a second simulation right after the first one only after it finished, but with 1 user instead of all of them which will clean up all resources.

I know I can use rendezVous to block until a predetermined amount of users reach that point, but how do I resume with just 1 user? Unless perhaps there’s a way I could block on a scn.inject() execution.

Thanks,
Carlos Torres

Being more specific.

I want to execute a scenario and when that scenario finishes, execute another scenario with a different injection model.

Something in these terms:

`
setUp(scn1.inject(…) andThen scn2.inject(atOnceUsers(1))
.protocols(httpConf)

`

where scn2 executes if and only if scn1 finished executing.

– Carlos

Correct me if I am wrong but I assumed when you chain exec in scenarios, they follow the order in which they were written

eg:

`
object doFirst{

val foo = exec(http(“Form”)…

}

object doSecond{

val bar = exec(http(“Form”) …

}

val scnr = scenario(“work”).exec(doFirst.foo, doSecond.bar)

setUp(
scnr.inject(rampUsers(1) over(1 seconds)))

`

So when the code runs doFirst.foo will run before doSecond.bar by the same user.

Just doif statements if you don’t want to run the 2nd exec when the 1st one fails

That’s not Gatling’s responsibility, but the one of the scheduler that launches Gatling.