artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
7.91k stars 505 forks source link

Request capture is breaking the flow #519

Open Punji opened 6 years ago

Punji commented 6 years ago

If I run the configuration below on v.1.6.0-22:

{
  "config": {
    "target": "https://artillery.io",
    "phases": [
      {
        "duration": 10,
        "arrivalRate": 1
      }
    ]
  },

  scenarios: [
    {
      "name": "test",
      "flow": [
        {
          "log": "Root"
        },
        {
          "get": {
            "url": "/",
            "capture": {
              "header": "Content-Type",
              "as": "contentType"
            }
          }
        },
        {
          "log": "Docs"
        },
        {
          "get": {
            "url": "/docs",
          }
        },
      ]
    }
  ]
}

The console output is :

Started phase 0, duration: 10s @ 12:18:14(-0300) 2018-08-16
/ Root
/ Root
| Root
| Root
\ Root
\ Root
- Root
- Root
- Root
Report @ 12:18:24(-0300) 2018-08-16
...

But if I remove the 'capture' element, the console output is:

Started phase 0, duration: 10s @ 12:21:26(-0300) 2018-08-16
/ Root
- Docs
/ Root
/ Docs
| Root
| Docs
| Root
| Docs
\ Root
\ Docs
\ Root
\ Docs
- Root
\ Docs
- Root
- Docs
/ Root
- Docs
Report @ 12:21:36(-0300) 2018-08-16
...

It looks like the 'capture' is causing the flow to be interrupted.

Punji commented 6 years ago

I changed "Content-Type" to "content-type" and it worked. I only found this after logging the response headers. This result is similar to issue #455. So, is this the intended behavior here? If a capture fails then the flow is interrupted?