postmanlabs / newman

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

newman 6.2.0 exception - node:internal/event_target:1090 process.nextTick(() => { throw err; }); #3267

Open 195858 opened 3 weeks ago

195858 commented 3 weeks ago
  1. Newman Version (can be found via newman -v): 6.2.0
  2. OS details (type, version, and architecture): github workflow - ubuntu-latest - node 22.6
  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: Occured 2 hours ago, just after 6.2.0 was released (newman is installed and run run every 2 hours via github workflow)
  5. Expected behaviour: run newman successfully, no exceptions
  6. Command / script used to run Newman: newman run ${{ github.workspace }}/test/postman/DevPortal-APIM-Test.json --folder "EAP-List-Paging" --folder "EAP-Queries" --folder "EAP-Details" -e https://api.getpostman.com/environments/xxx?apikey=${{ secrets.POSTMAN_APIKEY }} -r htmlextra,cli --reporter-htmlextra-export ${{ github.workspace }}/${{ env.TEST_TEST_RUNNER_OUTPUT_DIR }}/postman-report.html --reporter-htmlextra-darkTheme --delay-request 100
  7. Sample collection, and auxiliary files (minus the sensitive details): not applicable
  8. Screenshots (if applicable): not applicable

The github workflow used to run successfully every two hours and started to fail upon release of 6.2.0 to NPM.

Now fails with

node:internal/event_target:1090
  process.nextTick(() => { throw err; });
                           ^
Error: global is not defined
    at lib/core/connect.js (node:internal/deps/undici/undici:2179:5)
    at __require (node:internal/deps/undici/undici:6:50)
    at lib/dispatcher/client.js (node:internal/deps/undici/undici:7246:26)
    at __require (node:internal/deps/undici/undici:6:50)
    at lib/dispatcher/pool.js (node:internal/deps/undici/undici:7750:18)
    at __require (node:internal/deps/undici/undici:6:50)
    at lib/dispatcher/agent.js (node:internal/deps/undici/undici:7833:16)
    at __require (node:internal/deps/undici/undici:6:50)
    at lib/global.js (node:internal/deps/undici/undici:7933:17)
    at __require (node:internal/deps/undici/undici:6:50)

After downgrading to 6.1.3 the workflow is operational again / error is not thrown.

Here's the relevant parts from the github workflow:

    jobs:
      regression_test:
        permissions:
          repository-projects: read
          contents: read
          id-token: write
        runs-on: ubuntu-latest
        strategy:
          max-parallel: 1
          matrix:
            node: ["22"]
        steps:
          - name: github-slug-action
            uses: rlespinasse/github-slug-action@v4.4.1

          - name: Checkout Current Branch
            uses: actions/checkout@master
            with:
              ref: ${{ github.ref }}

          - name: setup node
            uses: actions/setup-node@v3
            with:
              node-version: ${{ matrix.node }}

          - name: npm install
            run: |
              cd "${TEST_PLATFORM_DIR}"
              npm install

          - name: Create newman folder
            run: |
              mkdir -p /home/runner/work/newman

          - name: Install newman
            run: |
              npm install -g newman
              npm install -g newman-reporter-htmlextra
              npm install -g newman-reporter-cli-response
            working-directory: /home/runner/work/newman

          - name: Create Directory for test results
            run: mkdir -p ${{ github.workspace }}/${{ env.TEST_TEST_RUNNER_OUTPUT_DIR }}
          - name: Run POSTMAN collection
            run: |
              newman run ${{ github.workspace }}/test/postman/DevPortal-APIM-Test.json --folder "EAP-List-Paging" --folder "EAP-Queries" --folder "EAP-Details" -e https://api.getpostman.com/environments/xxx?apikey=${{ secrets.POSTMAN_APIKEY }} -r htmlextra,cli --reporter-htmlextra-export ${{ github.workspace }}/${{ env.TEST_TEST_RUNNER_OUTPUT_DIR }}/postman-report.html --reporter-htmlextra-darkTheme --delay-request 100
            working-directory: /home/runner/work/newman
A1811-qbite commented 3 weeks ago

I'm story

rahul-mereddy commented 3 weeks ago

We are having issues with 6.2.0 version causing newman tests stuck.

Tested with 6.1.3 and able to pass the newman tests.

appurva21 commented 3 weeks ago

Hey folks! Thanks for reporting this. I can reproduce it on node v22.3.0 and above.

While we land a fix for this, as a workaround, you can downgrade your node version to v22.2.0 or below for running newman v6.2.0.

A1811-qbite commented 3 weeks ago

Alphawebplusalphabeta

silverwind commented 3 weeks ago

Was this fixed in 6.2.1? If so, please close.

paulina-grunwald commented 3 weeks ago

We are having issues with 6.2.0 version causing newman tests stuck.

Tested with 6.1.3 and able to pass the newman tests.

we have same problem