Repository navigation
test(browser): fix three flaky journeys seen across open PRs - #2957
Conversation
- channel-completion: build the mentions fixture once and serve the bundle, as mentions.spec.mjs does (#2776). Each test started its own dev server, and the first cold navigation hit the 15s timeout on both engines in #2935's flake check. The build keeps the dev server's unrounded CSS: Tailwind's optimizer and Vite's CSS minifier round the 20/14 line-height to 1.42857, moving the popup 1/32px off the 4px gap WebKit measures. - profiles: after Escape closes the profile panel, wait for the address to leave the profile before reopening Members. Focus returns before the panel's history return lands; in #2909's WebKit flake check the reopened dialog was replaced by the profile panel. - timeline edge(): repeat the edge gesture while it makes progress. One Linux WebKit wheel ended 199px short of the top in history-prefix (#2937); each extra gesture must still move, so an immobile timeline fails. Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz> Signed-off-by: Bradley Axen <baxen@squareup.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6305c03fd9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,86 +1,167 @@ | |||
| import { test, expect } from "./playwright-test.mjs"; | |||
| import { createServer } from "./vite-server.mjs"; | |||
| import { build, preview } from "./vite-server.mjs"; | |||
There was a problem hiding this comment.
Add the missing Signed-off-by trailer
When this commit is submitted in a PR, the required hosted DCO Check will fail because the commit message contains no Signed-off-by trailer. Re-create the commit with git commit --signoff so every commit carries the required attribution.
AGENTS.md reference: AGENTS.md:L268-L273
Useful? React with 👍 / 👎.
Summary
These are fixes for three browser-journey flakes that are failing open PRs which don't touch the code under test. The change is test-only. No browser cases are added or removed, and no assertion is relaxed.
The red
Browser journeys (chromium, 3/9)/(webkit, 4/14)shards on most open PRs come from a different problem:sidebar-geometry.spec.mjs:224is broken on main. #2945 and #2946 already fix it, so this PR leaves it alone.1.
channel-completion.spec.mjs: cold dev-server load timed outEvidence:
Flake checkon #2935 failedchannel-completion.spec.mjs:7on both engines withpage.goto: Timeout 15000ms exceededon/tests/fixtures/mentions.html?channels&stream&test-controls(chromium, webkit). #2935 doesn't touch that page.Cause: this is the same cold load #2776 fixed for
mentions.spec.mjs. Each test here started its own Vite dev server for the same ~1,600-module fixture.Fix:
beforeAllbuildsmentions.htmlonce and serves it withbuild/preview, using the same config asmentions.spec.mjs.1.42857, so line boxes become19.99998px. In WebKit that put the popup4.03125pxabove the composer, and the test asserts exactly4. I confirmed this locally: it fails 5/5 with either setting left on and passes with both off. Turning both off keeps the geometry the test checked before.2.
profiles.spec.mjs:940: reopening Members right after closing the profileEvidence:
Flake check (webkit, 8/9)on #2909 failed in repeat 8 of 10 (job). The trace shows this sequence:Escapecloses the profile panel.Enteris pressed 10ms later.Entershows the Profile panel again and no Members dialog, so the nextrow.clicktimes out.Fix: after each
Escape, wait for the address to leave the profile (no"detail"in the#buzz=hash) before reopening Members. This is a lifecycle barrier, not a delay. One step in this test already waited for the panel to unmount before reopening; the other steps didn't wait at all.Product follow-up (not fixed here): the order of a dismissal's history return and a quick reopen matters.
history.goby 300ms, the unpatched test takes a different path: the dismissal'sgo(-1)never runs, and the URL stays on the profile visit under the reopened dialog.browser-historyunit sketch (deferred traversal:push(channel),push(panel),dismiss([panel]), thenpush(settings)before the traversal commits) lands onchannel. The newsettingsvisit is undone.Someone who owns navigation should decide whether a push during a pending dismissal return should be deferred or replayed. That is a navigation-history change, not a test fix.
3.
timeline.mjsedge(): one wheel gesture stopped shortEvidence:
Browser journeys (webkit, 6/14)on #2937 failedhistory-prefix.spec.mjs:37withwheel reaches timeline edge,Received: 199(job). The trace shows the one-3251pxwheel ended withscrollendand the geometry then held still, so the poll could never pass.Fix:
edge()repeats the gesture, at most four times, until the edge is reached. Every extra gesture must reduce the distance, so an immobile timeline still fails.upper()already follows this rule. The case of already being at the edge is unchanged: it still sends one small wheel so production can start paging.Not in this PR, from the same survey of the 40 most recently updated open PRs
sidebar-geometry.spec.mjs:224(Drafts & sent row) is broken on main since fix(sidebar): align Drafts & sent row with channel rows #2733 + Make drafts and sent part of Messages #2728 crossed. fix(sidebar): realign the Drafts & sent row with channel rows #2945 is green and fix(sidebar): give Drafts & sent the page rows' icon box #2946 is in CI; either one fixes it.solo-chats.spec.mjs:322(Share, webkit, on Add Codex huddle auto-join and thinking presence #2927) is being handled in draft test(solo): wait for the header wrap and chat scroll before Share focus #2933.layout.spec.mjs:803on Forward Claude Code and goose inference to the agent gateway natively #2916 is already fixed on main by test: wait for the companion default width measurement #2750. Forward Claude Code and goose inference to the agent gateway natively #2916's merge ref predates it.Validation
All runs were local on macOS with
tests/browser/playwright.ci.config.mjsand--no-deps. These are not hosted CI measurements.channel-completion.spec.mjs,--repeat-each=5, both engines: 20/20 passed with the change. Before the CSS settings were added, the built fixture failed WebKit 5/5 (4.03125).profiles.spec.mjs:940,--repeat-each=24 --workers=6, WebKit: passed. It also passed withhistory.go/back/forwarddelayed by 300ms, in both engines.history-prefix,history-loading,scroll,timeline-setupandnew-message-boundary(all callers ofedge()/end()), both engines: 70/70 passed.history-prefix,channel-completionandprofilesfiles, both engines: 43/44 passed. The one failure wasprofiles.spec.mjs:6in WebKit, a test this PR doesn't touch. It then passed 4/4 both with and without this change.Deferred and remaining gaps:
edge()callers (24 spec files) are left to CI.