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]: UI Mode restart doesn't restart server with reuseExistingServer: false #32103

Closed
karlhorky opened this issue Aug 9, 2024 · 1 comment · Fixed by #32263
Closed

[Bug]: UI Mode restart doesn't restart server with reuseExistingServer: false #32103

karlhorky opened this issue Aug 9, 2024 · 1 comment · Fixed by #32263
Assignees
Labels

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Aug 9, 2024

Version

1.46.0

Steps to reproduce

  1. Make sure you have reuseExistingServer: false configured (this is the default if unconfigured in playwright.config.ts)

  2. Start Playwright UI Mode with playwright test --ui

  3. Wait for server to start

  4. Click on the "Reload" button (screenshot below)
    Screenshot 2024-08-09 at 19 23 28

  5. Click on the "Toggle Output" button (screenshot below)
    Screenshot 2024-08-09 at 19 32 49

  6. Observe the "already used" error message(s)

    $ NODE_ENV=test yarn start
    [WebServer] Listening at http://localhost:3000
    warning package.json: No license field
    $ NODE_ENV=test yarn start
    warning package.json: No license field
    [WebServer] Listening at http://localhost:3010
    [WebServer] GET /icons/icon-48x48.png?v=dad84ffd6565cb5f517328c25c456b99 302 3.466 ms - 28
    [WebServer] GET /login 200 2.570 ms - 460184
    
    Error: http://localhost:3000 is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.
    
    Error: http://localhost:3000 is already used, make sure that nothing is running on the port/url or set reuseExistingServer:true in config.webServer.
    

    Screenshot 2024-08-09 at 19 16 14

Alternative step 4 (after macOS system sleep):

  1. Sleep the macOS system (apple menu -> Sleep) and re-wake. Click on "Reload the page" link in the "UI Mode disconnected" screen:
    Screenshot 2024-08-09 at 19 17 33

Expected behavior

Servers are also restarted when clicking on "Reload" button or "Reload the page" if reuseExistingServer: false

Actual behavior

Servers are not restarted when clicking on "Reload" button or "Reload the page" if reuseExistingServer: false, leading to "already used" errors described above

Additional context

No response

Environment

System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1
    Memory: 70.97 MB / 16.00 GB
  Binaries:
    Node: 20.15.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.7.0 - /opt/homebrew/bin/npm
    bun: 1.1.21 - /opt/homebrew/bin/bun
  IDEs:
    VSCode: 1.92.1 - /opt/homebrew/bin/code
  Languages:
    Bash: 5.2.0 - /opt/homebrew/bin/bash
@karlhorky
Copy link
Contributor Author

Thanks for #32263 🙌

I can confirm that @playwright/test@1.47.0 no longer has the buggy behavior 🎉

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

Successfully merging a pull request may close this issue.

4 participants