Repository navigation
test(e2e): settle the sidebar toggle after the breakpoint change - #1326
Merged
Merged
Conversation
Returning from the mobile breakpoint restores the desktop sidebar preference in an
effect, so the toggle can swap from "Show sidebar" to "Hide sidebar" between the
`isVisible()` check and the click. The click then waits its full 30s for a button
that will not come back, and the suite dies with
locator.click: Timeout 30000ms exceeded. waiting for
getByRole('button', { name: 'Show sidebar', exact: true }) at e2e/run.mjs:496:60
Seen on several unrelated PRs (agegr#1322, agegr#1324 ourselves, agegr#1308 from another
contributor).
The click now retries against a short deadline and only its own timeout is
ignored; the wait for "Hide sidebar" that follows still fails if the sidebar never
opens, so a real regression is not hidden. The fork's earlier 947c7fe reload
fallback does not cover this signature: it fires only when neither toggle appears
within its 10s bound.
Owner
|
Thanks @brynne8, this is the right fix. The recent CI failures at |
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…gr#1326) Returning from the mobile breakpoint restores the desktop sidebar preference in an effect, so the toggle can swap from "Show sidebar" to "Hide sidebar" between the `isVisible()` check and the click. The click then waits its full 30s for a button that will not come back, and the suite dies with locator.click: Timeout 30000ms exceeded. waiting for getByRole('button', { name: 'Show sidebar', exact: true }) at e2e/run.mjs:496:60 Seen on several unrelated PRs (agegr#1322, agegr#1324 ourselves, agegr#1308 from another contributor). The click now retries against a short deadline and only its own timeout is ignored; the wait for "Hide sidebar" that follows still fails if the sidebar never opens, so a real regression is not hidden. The fork's earlier 947c7fe reload fallback does not cover this signature: it fires only when neither toggle appears within its 10s bound.
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…gr#1326) Returning from the mobile breakpoint restores the desktop sidebar preference in an effect, so the toggle can swap from "Show sidebar" to "Hide sidebar" between the `isVisible()` check and the click. The click then waits its full 30s for a button that will not come back, and the suite dies with locator.click: Timeout 30000ms exceeded. waiting for getByRole('button', { name: 'Show sidebar', exact: true }) at e2e/run.mjs:496:60 Seen on several unrelated PRs (agegr#1322, agegr#1324 ourselves, agegr#1308 from another contributor). The click now retries against a short deadline and only its own timeout is ignored; the wait for "Hide sidebar" that follows still fails if the sidebar never opens, so a real regression is not hidden. The fork's earlier 947c7fe reload fallback does not cover this signature: it fires only when neither toggle appears within its 10s bound.
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.
What it does
Makes the sidebar-toggle wait after the mobile→desktop breakpoint change deterministic
instead of racy, in
e2e/run.mjsonly.Returning from the mobile breakpoint restores the desktop sidebar preference in an effect,
so the toggle can swap from Show sidebar to Hide sidebar between the
isVisible()check and the click. The click then waits its full 30s for a button that will not come back.
The change retries the click against a short deadline (5 attempts, 1s each, 200ms apart) and
ignores only that attempt's own timeout. The
hideSidebar.waitFor(...)that follows isunchanged, so if the sidebar never opens the test still throws rather than passing.
Why it matters
The flake is not ours and not caused by any product change. The observed CI failure:
It has flaked at least three unrelated PRs: #1322, #1324 and another contributor's #1308.
Each red run costs a full e2e re-run and obscures real regressions in the same job.
Note the fork's earlier
947c7fedoes not cover this signature: its reload fallback onlyfires when neither toggle appears within 10s, whereas here a toggle is present and the race
is between the check and the click.
Scope
One test-stability change on today's
main; one change per PR. No product code, no othertests, no reformatting.
Testing
bun run lint— clean.bun x tsc --noEmit— clean.npm test(Node 26.7.0) — 2777 passed, 0 failed, 1 skipped.npm run test:e2ewas not run: upstream'se2e/run.mjslaunches Chromium and noChromium binary is installed in this environment (
Executable doesn't exist at …/chromium_headless_shell-1243/…). Only WebKit is present. The race is intermittent, so alocal clean run would not have proved much either; CI is the real check.
Provenance
Derived from the fork's
947c7fe/314fc57sidebar-toggle stabilisation, extended for thecheck-then-click signature those commits do not cover.