Repository navigation
e2e: every test ends at the top of its window - #451
Merged
Merged
Conversation
On CI's Linux runner, autoplay-next-episode's tests hung until mocha's 120 s timeout (main after #450, #449's runs; 2026-10-11). The step logs show where: each hang came in a test's first browser.url(), before its first step, and each in a test after one that ended switched into the player's frame (not every such test hung: a race in the driver). The navigation replaces the page, and the frame the driver waited in goes with it. A mocha root hook now switches to the window's top after every test, in every suite (framed-player.e2e.mjs did it on its own). A window or session already gone is expected; any other failure of the reset is logged, so a reset that stops working shows. Reviewed by deepseek, kimi and glm (the diagnosis; the logging and the wording are their findings). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the root hook, a test no longer starts in the frame the one before ended in. firefox-vpn's second test clicked the player's VPN button without switching into the player, relying on the first test to leave it there - on #451's CI it ran in the page (no button, no chrome.permissions there), and the third test failed after it (no permission given). It now enters the player first; its page is the first test's, nothing navigates. Locally 3/3; deepseek, kimi and glm: nothing real. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
Merged
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.
Main's CI after #450 failed on
autoplay-next-episode(Linux). That spec is the second source of today's CI failures.What the step logs (added in #449) showed. Every hang:
browser.url(), before the first step logs;A test after one that ended at the window's top never hung. It's a race in the driver, not a rule: the retry once got through the same setup. The navigation replaces the page, and the frame the driver was waiting in disappears with it, until mocha's 120 s timeout.
Fix. A mocha root hook (
tests/e2e/setupGuard.mjs) switches to the window's top after every test, in every suite;framed-player.e2e.mjsalready did this on its own. A window or session that's already gone is expected and stays quiet. Any other failure of the reset is logged, so a reset that stops working gets noticed. The unit test fails without the hook.Reviewed by deepseek, kimi and glm:
Checks: unit
e2eHarness27/27, lint, typecheck, and locallyautoplay-next-episode4/4,framed-player4/4,content-overlays8/8.🤖 Generated with Claude Code