Repository navigation
fix: keep waiting for page readiness when the page replaces its document mid-wait - #7029
Merged
Merged
Conversation
…ent mid-wait wait_until_ready read each standing through a JSHandle the old document returned. A page that replaces its document on the way to ready, as a revision that cannot be patched in does, could destroy that context between the answer and the read, and the wait raised "Execution context was destroyed" instead of waiting on in the new document. The scheduled macOS run 45378690705 failed test_a_user_working_an_obligation_keeps_it_across_a_replacing_document this way. A model test with a page whose first read fails like that fails before the change and passes after it. Refs #7022
leaf-agent
added a commit
that referenced
this pull request
Nov 24, 2026
…plit it (#7030) CodeMirror's history starts a new undo step when a run of keystrokes pauses longer than its group delay. `test_words_typed_while_the_editor_loads_are_its_first_words` typed `kept ` after the editor loaded and expected a single undo to remove it. On the scheduled macOS run [45378690705](https://github.com/max-sixty/leaf/actions/runs/45378690705), Firefox typed slowly enough to split the word, and the first undo left `Typed ear and\nkely`. The test now types one key there. One key is one transaction however slowly the runner types, so the test still checks what it protects: words typed before the editor loads are one undo step, separate from words typed after it arrives. Before the change, a 700 ms pause between `ke` and `pt ` reproduces the nightly's `kely` locally on both Chromium and Firefox. After it, both engines pass. A dispatch of the unchanged test alone on the macOS runner passed 18 of 18 copies, so the failing nightly is the before evidence on that runner. Refs #7022 — automated triage. #7022's other failure, the readiness probe across a replacing document, is fixed separately in #7029. Co-authored-by: leaf-agent <[email protected]>
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.
wait_until_readywaits on a page throughwait_for_function(...).json_value(). A page can replace its document on the way to ready, as a revision whose executable identity differs does, and if that happens between the old document's answer and the read of its handle, the read raisesExecution context was destroyedand the whole wait fails. The scheduled macOS run 45378690705 failedtest_a_user_working_an_obligation_keeps_it_across_a_replacing_documentthis way, insidetold→wait_until_ready. The wait now treats that error as the document moving on and keeps waiting in the new document, within the same no-progress bound. Any other Playwright error still raises.The fix sits in
wait_until_readyrather than in the one test, because every caller that writes a version behind a live page (told, the render gate) waits across the same possible replacement.test_a_handover_that_replaces_the_document_waits_on_in_the_new_oneuses a fake page whose first read fails with Playwright's error. It fails without the change and passes with it. A dispatch of the failing test alone on the macOS runner (--workers 1 --load 4, 18 copies, frommain) passed every copy, because the window is the gap between two driver calls. So the failing nightly is the before evidence, and the next scheduled run is the after.Refs #7022 — automated triage. #7022's other failure, the Firefox undo grouping, is fixed separately in #7030.