Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] HTML Report Server EADDRINUSE (yarn v1 issue?) #11190

Closed
rwoll opened this issue Jan 5, 2022 · 5 comments
Closed

[BUG] HTML Report Server EADDRINUSE (yarn v1 issue?) #11190

rwoll opened this issue Jan 5, 2022 · 5 comments

Comments

@rwoll
Copy link
Member

rwoll commented Jan 5, 2022

Context:

  • Playwright Version: 1.17, ToT

System:

  • OS: macOS 12.0.1
  • Memory: 4.47 GB / 32.00 GB

Binaries:

  • Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
  • Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn
  • npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm

Languages:

  • Bash: 5.1.8 - /usr/local/bin/bash

Repro

$ mkdir repro
$ cd repro
$ yarn create playwright
$ cat << EOF > tests/example.spec.ts
import { test, expect } from "@playwright/test";
test("example", () => expect(1).toBe(2));
test("another", async () => await new Promise(() => {}));
EOF

$ yarn playwright test --reporter html
$ # <Ctrl+C> to interrupt the tests (we have an unresolved promise to simulate a hanging test, so you need an interrupt)
$ # (you should now be looking at the HTML Report in the browser which has automatically been open)
$ # <Ctrl+C> to kill the report server as instructed int he terminal
$ # (observe the CLI process looks to have cleanly exited)

$ yarn playwright test --reporter html
$ # <Ctrl+C> to interrupt the tests (we have an unresolved promise to simulate a hanging test, so you need an interrupt)
$ # Observe the following error is thrown:
$ node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::9323
    at Server.setupListenHandle [as _listen2] (node:net:1334:16)
    at listenInCluster (node:net:1382:12)
    at Server.listen (node:net:1469:7)
    at HttpServer.start (…/repro/node_modules/playwright-core/lib/utils/httpServer.js:85:18)
    at showHTMLReport (…/code/repro/node_modules/@playwright/test/lib/reporters/html.js:118:26)
    at HtmlReporter.onEnd (…/code/repro/node_modules/@playwright/test/lib/reporters/html.js:88:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Multiplexer.onEnd (…/code/repro/node_modules/@playwright/test/lib/reporters/multiplexer.js:77:7)
    at Runner._run (…/code/repro/node_modules/@playwright/test/lib/runner.js:397:9)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1361:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '::',
  port: 9323
}
^C

Describe the bug

See repro steps above. If using yarn with playwright test, the HTML Report server sometimes gets orphaned. This means subsequent uses fail. (lsof -i :9323 with a kill on the process gets you unstuck.)

@rwoll
Copy link
Member Author

rwoll commented Jan 5, 2022

I think this is a yarn v1 issue (yarnpkg/yarn#4667), but haven't yet confirmed that it is fixed with v2. If someone already has v2 installed, please try out the repro steps and let me know! If it's confirmed as a bug in yarn, please close this issue!

Filed so if someone else hits it, the error is searchable. Possibly relates #10010.

@D-Pagey
Copy link

D-Pagey commented Jan 5, 2022

I had the same issue, also using yarn v1.22.15. Killing the process solved it.

@aslushnikov
Copy link
Collaborator

Thanks for filing! I'll close this in favor yarnpkg/yarn#4667

@geoffreyhale
Copy link

Am having same issue using npm not yarn

@baptisteArno
Copy link

Same issue with pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants