Is it possible to stop simulation before all requests are finished

Hi,

Let’s say I’ve got scenario which on average takes 10 minutes to finish single run i.e. user logs in, do some actions and logs out, and that includes wait times.

From what I’ve noticed if I configure Simulation setup to take just 2 minutes the whole execution will take at least that 10 minutes to make the whole scenario finish anyway.

Is there a way to ‘force’ Gatling to stop executing any new requests when the set up time finishes - in my case after 2 minutes rather that 10?

I’m on Gatling 3.0.3

My setup looks like this:

setUp(
  List(
    firstScenario
      .inject(
        rampConcurrentUsers(1)
          .to(targetConcurrency1)
          .during(rumpUpTime1),
        constantConcurrentUsers(targetConcurrency1)
          .during(targetDuration1))
      .uniformPauses(uniformPlusMinusTime)
      .protocols(httpConf),

    secodScenario
      .inject(
        rampConcurrentUsers(1)
          .to(targetConcurrency2)
          .during(rumpUpTime2),
        constantConcurrentUsers(targetConcurrency2)
          .during(targetDuration2))
      .uniformPauses(uniformPlusMinusTime)
      .protocols(httpConf)
  )
)

Thanks,
Michal

I use .maxDuration to ensure that my scenario stops when needed

Thanks Maria, that’s exactly what I missed.