bestboy
bestboy

Reputation: 55

Gatling 2: concurrent request handling

I have a question regarding the behavior of Gatling when using .exec in combination with .resources. The documentation describes the behavior very briefly:

Allows to fetch resources in parallel in order to emulate the behaviour of a real web browser

Let's consider the following, simple scenario:

  val scn = scenario("Test Scenario")
    .exec(
      http("Base Page").get("/")
        .resources(
          http("Resource A").get(host + "/resource_a.js"),
          http("Resource B").get(host + "/resource_b.js")
        )
    )

    .exec(
      http("Resource X").get(host + "/resource_x.js")
    )

My question is: When is the second .exec block for Resource X being executed?

a) As soon as the "main request" of the first .exec block returns (i.e. when the Base Page request returns)

b) When all requests of the first .exec block returned (i.e. when the Base Page as well as Resource A and Resource B have been fetched)

Upvotes: 5

Views: 2566

Answers (1)

Stephane Landelle
Stephane Landelle

Reputation: 7038

Answer is: b, when all resources have been fetched.

Upvotes: 4

Related Questions