pactumjs / pactum

REST API Testing Tool for all levels in a Test Pyramid
https://pactumjs.github.io
MIT License
545 stars 52 forks source link

"code": "ERR_HTTP_INVALID_HEADER_VALUE" when get request run in parallel #317

Closed spatchamatla closed 6 months ago

spatchamatla commented 8 months ago

Describe the bug when running tests in parallel, pactum js throws multiple console errors..Error performing request and "code": "ERR_HTTP_INVALID_HEADER_VALUE" . on retries it works fine

  console.error
    Error performing request

      at ../../node_modules/pactum/src/adapters/logger.js:26:24
          at Array.forEach (<anonymous>)
      at Object.error (../../node_modules/pactum/src/adapters/logger.js:26:7)
      at Logger.error (../../node_modules/pactum/src/plugins/logger.js:84:20)
      at getResponse (../../node_modules/pactum/src/models/Tosser.js:267:11)
      at Tosser.setResponse (../../node_modules/pactum/src/models/Tosser.js:76:21)
      at Tosser.toss (../../node_modules/pactum/src/models/Tosser.js:35:7)

  console.error
    {
      "code": "ERR_HTTP_INVALID_HEADER_VALUE"
    }

      at ../../node_modules/pactum/src/adapters/logger.js:26:24
          at Array.forEach (<anonymous>)
      at Object.error (../../node_modules/pactum/src/adapters/logger.js:26:7)
      at Logger.error (../../node_modules/pactum/src/plugins/logger.js:84:20)
      at getResponse (../../node_modules/pactum/src/models/Tosser.js:267:11)
      at Tosser.setResponse (../../node_modules/pactum/src/models/Tosser.js:76:21)
      at Tosser.toss (../../node_modules/pactum/src/models/Tosser.js:35:7)

To Reproduce Steps to reproduce the behavior:

  1. Run get request (50 requests) in parallel using Jest it.concurrent.each()
  2. See error

Expected behavior no error thrown on parallel runs

Software (please complete the following information):

ASaiAnudeep commented 8 months ago

Hey @spatchamatla , could you please share the debug logs here.