2

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?

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

3

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"
  • Where is that documented? – Archimedes Trajano Feb 08 '18 at 05:09
  • 1
    I derived it from: https://artillery.io/docs/basic-concepts/#example-testing-an-e-commerce-api They define step 4 as: `POST to the cart endpoint with the same id after pausing for 3 seconds` which gets turned into the following artillery code: `- think: 3 - post: url: "/cart" json: productId: "{{ id }}"` I couldn't find where 'think' is explicitly documented as a pause. – user9331104 Feb 09 '18 at 06:53
  • is there a way to add a random delay between requests ? – Jamesed Nov 25 '21 at 21:32