Search code examples
load-testingartillery

How do you add a pause in a flow for artillery?


Is there a way of injecting a 1 to 2 second pause within a flow for scenarios that are asynchrounous and immediately trying to get the value will fail unless it rested for a couple of seconds?


Solution

  • Use think with the number of seconds you'd like to pause for. In this example we GET /first_thing, wait two seconds, then GET /second_thing.

      - name: "Thinkflow"
        flow:
          - get:
               url: "/first_thing"
          - think: 2
          - get:
               url: "/second_thing"