Skip to content

fix: remove the causes of the top web e2e flakes - #1815

Merged
yansfil merged 4 commits into
mainfrom
fix/flaky-web-e2e-top
Oct 28, 2026
Merged

yansfil merged 4 commits into
mainfrom
fix/flaky-web-e2e-top

Conversation

@yansfil

@yansfil yansfil commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes with-hide/hide-private#147
Closes with-hide/hide-private#270
Closes with-hide/hide-private#161
Closes with-hide/hide-private#122
Closes with-hide/hide-private#168
Closes with-hide/hide-private#172
Closes with-hide/hide-private#195
Closes with-hide/hide-private#197

Summary

Five of the most frequent web e2e flakes are fixed at their cause, and one of them was a product race.
When a folder inside a repository was added as a project, one update could draw it apart from its repository, with no tabs and under "No agents", for about 10 ms.
The core now builds that update from path answers that already place the new project.
The other four were tests that waited on the wrong thing, and four more issues with the same tab failure close with them.
#287 needed no code, because its spec was deleted with Factory in #1437.

스크린샷 없음: no web/src, site/ or design/ change; the only product change is in the core's catalog build.

Review

  • 판단해 주세요: Restore task labels after session backlog and watcher restart #270 is fixed in the core, not in the test helper. The in-between update was wrong (the project shown apart from its repository, empty, under No agents), so showProjectRow is unchanged.
  • 판단해 주세요: the graph still remounts every card when it switches from plain layers to the placed layout. The switch waits on the asynchronous layout worker, up to LAYOUT_TIMEOUT_MS (3000 ms), so a click in that window can be lost. This PR only makes the test wait for layered; the product defect is with-hide/hide-private#317.
  • 판단해 주세요: the Redesign checkout rows and persist purpose #122 test now opens the record by focusing the row (focus-within), so it checks the focus path and no longer checks the hover reveal.
  • 조심해서 볼 파일: herdr-core/src/session_sync/coordinator.rs, the catalog build on the session-sync thread (high-frequency path). The change only chooses between two path indexes already in hand. When the coordinator's own answers place every registration (the usual case), nothing changes.
  • 비용 검토: each update adds one knows() lookup per local registration on at most two indexes, with no new reads, timers or fan-out.

Evidence

  • 확인한 것: the 8 tests behind these issues passed 20 repeats each on 42aa932 (160 passed, 0 failed). This is evidence for 42aa932; the commit after it changes docs only.
  • 확인한 것: a scratch probe (not committed) that read the wire frames reproduced the Restore task labels after session backlog and watcher restart #270 update before the fix and saw 0 of 31 after it.
  • 확인한 것: the new core unit test proves that a pending answer makes the catalog build from the path index that places every registration. It does not prove the screen frame; the probe above is the screen-level evidence.
  • 확인한 것: CI on 7d6ee3b passed in every lane that ran, and no lane reported a flaky test.
  • 확인하지 못한 것: clippy and the full Rust and web suites did not run locally (the disk had 0.8-1.8 GiB free); CI ran them. The Windows form of web: group the ⌘K palette in the Swift search form and add the sidebar Search field #161 is checked only in CI.
Verification record

Issues

Issue Flakes Cause Fix
#270 s4 registered subfolder History 17 Product: while the node's path answer was pending, the coordinator built the catalog from answers that predate the new registration and overwrote the creation's correct publish; the helper then clicked the vanished fold paths_to_build_from in the coordinator
#147 plan-review 24 The graph draws cards in plain layers, then mounts them anew once placed; boundingBox() read a removed card (null) Wait for data-dependency-layout="layered" (placedBoxes); mission-map had the same read
#161 checkout-owner linked worktree 15 waitForTerminal took the strip's selected tab as the expectation; the canvas drew the new tab while the strip still selected the old one The expected tab comes from Herdr (createdTabs), all 9 callers
#168 #172 #195 #197 - Same Expected: old tab / Received: new tab signature, same helper Same fix
#122 session-work-ledger report letter 1 Hover-only record button: a child nesting under the root moved the row away from a still pointer Reveal the buttons by focusing the row (focus-within)
#287 Factory questions 21 The spec was deleted with Factory in #1437 (cc80696) Closed with that evidence, no code

Repeat run (c2)

  • Commit: 42aa932 (head 7d6ee3b adds docs only).
  • Machine: macOS, one worker, debug hided with the core fix, pinned Herdr 0.9.5.
  • Command: scripts/verify-web.sh web e2e e2e/plan-review.spec.ts e2e/mission-map.spec.ts e2e/checkout-owner.spec.ts e2e/s4.spec.ts e2e/session-work-ledger.spec.ts e2e/herdr-coexistence.spec.ts e2e/last-tab-leaves-checkout.spec.ts e2e/s2.spec.ts --grep "<the 8 tests>" --repeat-each 20
  • Result: 160 passed, 0 failed, 19.4 min.
  • The other tests the helper change touches (checkout-owner, session-work-ledger, sidebar-menus, overview-device, s2 tab switch) passed once each, 15 in all.

#270 probe (not committed)

  • It logged the fold and the core's no_agent_projects from wire frames, with the real test's Git setup.
  • Before the fix, every batch of 12-20 runs (5 batches) had at least one publish of registered at its bare path with 0 tabs beside fixture and under No agents. One batch was counted exactly: 2 of 20.
  • After the fix: 0 of 31.

Static checks

  • verify-cargo.sh test -p herdr-core --lib: catalog_path_tests::a_pending_answer_builds_from_the_paths_that_place_every_registration passes.
  • web typecheck, web lint (e2e size budget included) and cargo fmt --check pass.

CI on 7d6ee3b

  • Passed: verify, gate, plan, policy checks, rust workspace, web and desktop checks, static-design, windows check, os contract linux and windows, remote mailbox, web e2e linux 1-6 of 6, windows e2e, desktop e2e macos 1-2 of 2, desktop e2e windows.
  • Skipped by path filter: agent CLIs, agent journey, agy contract, omp SDK contract, os contract macOS, package, windows wsl.
  • No lane reported a flaky test.

While the node's answer for a round's paths is pending, the session sync
coordinator built the catalog from its own previous answers. After a
project was registered those predate it, so the next publish drew the new
project at its bare path without the repository's tabs, beside the old
project, and put it under No agents until the answer arrived. The
creation already installed answers that place it; the coordinator now
builds from those when its own cannot place a registration of this
machine.
…selection

waitForTerminal read the strip's selected tab and expected the canvas to
draw it, but the canvas can draw a new tab while the strip still selects
the one before, so the expectation was the old tab. Every caller now names
the tab Herdr created (createdTabs) and the helper waits for the page to
select and draw that one.
A dependency graph mounts its cards anew when the layout worker places
them, so a box read before that was of a removed card (null). The record
button shows on hover or focus; a row that moved under a still pointer
lost the hover, so the specs now focus the row.
@yansfil
yansfil merged commit d5fdfbc into main Oct 28, 2026
70 checks passed
@yansfil
yansfil deleted the fix/flaky-web-e2e-top branch October 28, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant