Skip to content

[BUG] webServer.reuseExistingServer is broken on node 18 #24101

@edumserrano

Description

@edumserrano

System info

  • Playwright Version: [v1.35.1]
  • Operating System: [All]
  • Browser: [All]

Source code

  • I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

Steps

  1. Clone this repo and using your shell of choice navigate to the root of the repo.
  2. Execute npm start. This will build and run an angular app.
  3. Once the angular app is running, execute npm test

When running with node 16.19.1 the output after step 3 is:

> demo-app@0.0.0 test
> npx playwright test


Running 1 test using 1 worker

  ✓  1 [chromium] › example.spec.ts:3:5 › dummy test (1.8s)

  1 passed (2.6s)

When running with node 18.16.0 the output after step 3 is:

> demo-app@0.0.0 test
> npx playwright test

[WebServer] ? Port 4200 is already in use.
Would you like to use a different port? (Y/n) [WebServer]
Error: Timed out waiting 30000ms from config.webServer.

As you can see, it tries to execute the webServer.command and then eventually times out because the port is already taken.

Expected

When running on node 18.16.0 it should NOT try to execute the webServer.command when webServer.reuseExistingServer is set to true.

Actual

When running on node 18.16.0 it executes the webServer.command when webServer.reuseExistingServer is set to true.

Other

I used nvm to swap between node versions whilst testing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions