Give each run its own browser instead of a machine-wide one - #65
Merged
Merged
Conversation
The keepAlive browser was found again through a socket file at one fixed path per machine ($TMPDIR/prestaflow-.browser), shared by every PrestaFlow process. A run reconnected to whatever Chrome that file named, and ExecuteSuite ended every run by closing that browser and deleting the file. So any run that finished while another was in flight, even a browser-free one such as a smoke suite, closed the other run's Chrome under it. The victim failed with "The page was closed and is not available anymore", typically on its first navigation, or silently lost its session when it relaunched a browser between two steps (an emptied cart, a checkout that no longer matches). Whether it happened depended on what else was running on the machine, not on the PrestaShop version under test. ExecuteSuite now scopes the socket and options files to the run (pid plus a random token) before it starts and releases only that browser at the end. Callers outside ExecuteSuite keep the shared path, and the reconnection they may rely on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two PrestaFlow processes running at the same time on one machine closed each other's Chrome.
Root cause
$TMPDIR/prestaflow-.browser. Every process read and wrote it.ExecuteSuite::execute()closed the browser named in that file, then deleted the file.Symptoms
The page was closed and is not available anymore, at the first step ofGuestCheckout.Proof
Checkout on 9.0.0, then psflowdemo's browser-free
Smokestarted 1.4 s later in another process:Target.getTargetsreturned nothing.Fix
ExecuteSuitescopes the socket and options files to its own run (run-<pid>-<random>), viaTestsSuite::scopeBrowserFilesTo().releaseBrowser()closes only that browser and deletes only those files.TestsSuitewithoutExecuteSuitekeeps the shared path, and with it reconnection to an existing browser.Verified
tests/Unit/Command/BrowserOwnershipTest.php, without a browser: 2 of its 4 tests fail without the fix. Full suite:OK (336 tests, 764 assertions).🤖 Generated with Claude Code