postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.89k stars 1.17k forks source link

Script execution timeout despite using the default timeout values (Infinity) #2595

Open grimsa opened 3 years ago

grimsa commented 3 years ago
  1. Newman Version (can be found via newman -v): 5.2.2

  2. OS details (type, version, and architecture): Linux 4.4.0-1118-aws #132-Ubuntu SMP Fri Nov 13 18:22:45 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  3. Are you using Newman as a library, or via the CLI? CLI

  4. Did you encounter this recently, or has this bug always been there: Saw it the first time, but there are similar issues reported (see below)

  5. Expected behaviour: Script execution does not time out (respects the default values - Infinity - specified in documentation: https://github.com/postmanlabs/newman#newmanrunoptions-object--callback-function--run-eventemitter)

  6. Command / script used to run Newman: newman run test/permit-ready-pv-system-design.postman_collection.json --working-dir test --env-var hostAndPort=0.0.0.0:32873

  7. Sample collection, and auxiliary files (minus the sensitive details): The collection in question contains around 70 endpoint calls, all with minimal scripting logic (e.g. check response status code, and maybe a few fields in response JSON). However, it includes several calls to endpoints that generate documents (one call taking 10+ seconds and receiving 10+ MB PDF/ZIP in response). The script failed after one of these calls.

  8. Screenshots (if applicable): N/A

Context

Normally, the same collection completes successfully (same machine, same Newman version). The error was observed on our CI server, which at the time was running builds of multiple microservices concurrently (therefore, requests may have been executing slower than normal).

Output from logs:

┌─────────────────────────┬────────────────────┬────────────────────┐
│                         │           executed │             failed │
├─────────────────────────┼────────────────────┼────────────────────┤
│              iterations │                  0 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│                requests │                 55 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│            test-scripts │                126 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│      prerequest-scripts │                 88 │                  0 │
├─────────────────────────┼────────────────────┼────────────────────┤
│              assertions │                 84 │                  0 │
├─────────────────────────┴────────────────────┴────────────────────┤
│ total run duration: 0ms                                           │
├───────────────────────────────────────────────────────────────────┤
│ total data received: 18.73MB (approx)                             │
├───────────────────────────────────────────────────────────────────┤
│ average response time: 1038ms [min: 82ms, max: 20.3s, s.d.: 2.9s] │
└───────────────────────────────────────────────────────────────────┘
error: Script execution timed out after 30000ms

Related issues

The same (or similar) problem seems to be reported here:

adityaofficial10 commented 3 years ago

@grimsa I'm trying to reproduce this and I'll try to come up with a fix soon.

k-anuradha commented 3 years ago

To add to this issue, it says generated report and later this script timeout error though no report is actually seen to be generated - newman version used - 5.2.3

image