Skip to content

money e2e: wait for the app save to sync before leaving the page (fixes the 'New app' flake) - #180

Closed
michielbdejong wants to merge 2 commits into
mainfrom
claude/money-e2e-flake
Closed

michielbdejong wants to merge 2 commits into
mainfrom
claude/money-e2e-flake

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Fixes the intermittent locator.click: Timeout 10000ms on menuitem 'New app' in integrations/money/e2e/money.spec.ts. It was seen in runs 36140727009, 36152023575 and 36152145164, plus their retries.

Root cause, from the traces:

  • installApp saves the app's name, renders class and source, then navigates to the table about 1.2–1.4 s later, before that save has synced.
  • The "Add view" menu's app list (atomic-server useDriveApps.ts) is read once, when the table page mounts, and isn't re-read when the app arrives through sync 0.4–0.9 s later. So "New app" never shows up. The menu was open, with no overlay, online, and the import done.

Fix:

  • call waitForSynced from atomic-server's test-utils at the end of installApp, the documented remedy for save-then-navigate;
  • do the same after the row edit's save().

No timeouts or retries were changed.

Checks:

  • the money lane passed 5 times in a row locally at 2567fc30b, and again with pets e2e running in parallel;
  • oxlint, oxfmt and the e2e tsc are clean.

Host note: the "Add view" menu doesn't pick up an app changed after the page loaded, for example in another tab, until a reload.

🤖 Generated with Claude Code

Michiel de Jong and others added 2 commits September 25, 2026 18:34
The "Money app" test flaked in CI (runs 36140727009, 36152023575,
36152145164; five failed attempts, all identical) on
`getByRole('menuitem', { name: 'New app' }).click()`. The traces show
the "Add view" menu open with only Table, Kanban, Calendar, Timer,
Dashboard and Issues. `installApp` saved the App (name, `renders`,
source) and the spec navigated 1.2-1.4 s later, before that save had
synced; the next page's `useDriveApps` reads the drive's apps once on
mount, and the App's commits only arrived by ws-sync-push 0.4-0.9 s
after the menu had opened, so it never listed the app.

Wait with test-utils' `waitForSynced` (outbox empty, ClientDb flushed)
after `installApp`, and after the row edit in the first test, which
navigates away right after `save()` the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong

Copy link
Copy Markdown
Contributor Author

Closing as superseded. This PR added waitForSynced to the money e2e to work around the "New app" menuitem not appearing. The root cause was host bug ontola/atomic-server#1846 (useDriveApps not live), fixed by #1847 in candidate14, which main now pins (#179). At that pin the unchanged money spec passes: #171's Lane: money (e2e) succeeded. With this PR's changes on top, the same test failed twice at the same pin (run 36584202173, the "New app" click timing out), so the extra waits don't help and may hurt. The branch stays on origin.

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