test: relaunch a disconnected cached browser in tests#2368
Open
thomasbachem wants to merge 1 commit into
Open
Conversation
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.
The Windows screenshot flakes in #2137 are
TargetCloseErrors (Target closed), which is what you get from reusing a browser that already died.withBrowser(tests/utils.ts) caches one browser perlaunchOptionskey, but the cache-hit path only checks that an entry exists, not that it's still connected – and nothing evicts a dead one. So a single browser death mid-run (a pipe drop, an OOM, a teardown race) leaves every later same-key test reusing the dead handle, turning one failure into a run of them.#2205's concurrency limit lowers how often a browser dies; a liveness check on cache hit bounds the blast radius when one still does – a disconnected browser is dropped and relaunched, so a death fails only its own test. Inert on a healthy run, since
connectedonly goes false once the connection is actually gone.The test closes a cached browser and asserts the next
withBrowsercall gets a fresh, connected one – it fails onmainand passes with the check.