Repository navigation
Make the restored-frame-tab test's frame delay actually reach the frame - #771
Merged
Merged
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.
test_interaction_gallery_waits_for_a_restored_frame_tabnames the arrangement it needs — a remembered chrome demo whose inner Leaf page is slow to arrive — and then never makes it. Its init script was written as a bare arrow function, andadd_init_scripttakes source rather than a function Playwright calls, so the document evaluates the arrow, discards it, andElement.prototype.appendis never patched. Wrapping it in the IIFE the suite's other init scripts use makes the delay real.Measured on the frame after the reload, with a counter added to the script body: the arrow form reports
patched False, delayed 0and the demo is ready 4.8s in; the IIFE form reportspatched True, delayed 2and ready at 7.7s — the two contained<script>appends each held back the stated 2s. The test passes either way, so nothing was red; it was simply proving the ordinary path twice rather than the slow one it is named for.This is the only
add_init_scriptcall in the suite written that way — the others pass plain statements or(() => { … })(). The same string form is correct forevaluate, which is where the rest of the tree's"""() => …"""blocks live, and which is presumably where this one came from.Found while diagnosing the nightly failure in #770; the two changes are independent.
Verification
uv run pytest tests/test_site.py::test_interaction_gallery_waits_for_a_restored_frame_tab -n0 --run-nightlypasses on repeat runs with the delay in force, andpre-commit run --files tests/test_site.pyis clean.test_site.pyis nightly-only, so the everyday gate is unaffected.