Skip to content

fix: persist the port of the running playwright server - #321

Merged
MrPunyapal merged 5 commits into
pestphp:5.xfrom
cyppe:fix/stop-playwright-server
Nov 18, 2026
Merged

MrPunyapal merged 5 commits into
pestphp:5.xfrom
cyppe:fix/stop-playwright-server

Conversation

@cyppe

@cyppe cyppe commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

ServerManager::playwright() finds a new port and persists it on every call, even after the server has been created. The server keeps listening on its original port, so after a second call (for example from Browsable or the terminate hook) the persisted state points at a port nobody listens on, and each call opens a socket for nothing.

This creates the server, and persists its host and port, only once.

Supersedes #169, rebased onto 5.x as requested by the maintainers; original work by @biinari. The other half of #169 (running playwright run-server so that stopping it reaches node) is covered by #254.

The added test fails on 5.x (the persisted port differs from the server's port) and passes with this change. composer test passes locally.

biinari and others added 2 commits November 16, 2026 21:03
If playwright is already defined, do not try to persist again with a new port
@MrPunyapal
MrPunyapal merged commit 8a8912b into pestphp:5.x Nov 18, 2026
2 checks passed
@MrPunyapal

Copy link
Copy Markdown
Member

Thanks

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

Successfully merging this pull request may close these issues.

3 participants