Skip to content

test(e2e): intermittent failure in "a failed ordinary save cannot silently leave by SPA navigation" #83

Open

Description

@TusanHomichi

Observed

One failure in a local full-suite run on 3586f57 (PR #82). The PR does not touch web/, so main has the same app and test code. The run used system Chromium 141.0.7390.37, as euid 0 with the DAC capabilities dropped.

e2e/draft-recovery.spec.ts:2367 failed at homeSessions() (line 436): getByRole('heading', { name: 'My sessions' }) was not visible within 5000 ms after clicking Home, following a successful retry save.

The Playwright snapshot at failure shows the page still on the draft:

  • the save state is "Saved", and the narrative shows the corrected retry text;
  • the stale alert from the earlier refused departure is still shown: "The draft did not save. Stay on this draft and save again before leaving.";
  • every editor input is disabled;
  • the header and notice badge are present.

So the save succeeded and expectUnloadReady passed, but the SPA departure to / never rendered the home page within the timeout. The disabled inputs suggest a navigation in flight or wedged. The alert not being replaced suggests beforeNavigate did not cancel again.

Reproduction attempts

  • The same full suite on 7241232 an hour earlier: 56/56 passed.
  • npx playwright test e2e/draft-recovery.spec.ts:2367 --repeat-each=8 on a quiet machine: 8/8 passed, about 8.4 s each.
  • The same command with all 4 CPUs saturated by busy loops: 8/8 passed, 14–16 s each.
  • During the failing run, a separate Playwright session was driving its own server on the same host. That timing overlap is plausible but unconfirmed, and load alone did not reproduce the failure.

Not established: whether the home load stalled, or whether the editor's departure state (hasFailedOrdinarySave cleared? busy?) blocked or held the navigation. Not a "flake" until the cause is known.

Evidence

  • Local receipt: .proof/20261014T153007Z-3586f57a72f2/ on the contributor's machine. receipt.json sha256 6ae1494f9c0980148e666d84b94fa59b5d5e0be40530f4fcedcd3d582053e12b; step 7 log sha256 prefix d9c774afe7195542. Not attached, since it is local only.

Next action

Instrument the test with a trace on failure (trace: 'retain-on-failure') and repeat the full draft-recovery.spec.ts file, not just the one test, to capture the departure state when it recurs.

Refs #34, #67

Activity

  1. TusanHomichi commented on Oct 14, 2026

    @TusanHomichi
    MemberAuthor

    Second occurrence and investigation

    Recurred once more in a local full proof on 488b531 (PR for #93, which doesn't touch the draft page). It was the same step: homeSessions() at line 436 after the retry save. A full cargo build was running in another checkout on the same 4-CPU host at the time. Both recorded failures overlapped heavy concurrent work.

    Not reproduced since:

    • the test alone, --repeat-each=30 --workers=2: 30/30 passed;
    • the whole draft-recovery.spec.ts, --repeat-each=2 --workers=2, with a cold cargo build -p consolebook-server running alongside: 94/94 passed;
    • a full proof on the fix below: 59/59 passed.

    Found and fixed while looking, in #104 (merged): the stale "The draft did not save. Stay on this draft…" alert in the failure snapshot was a real bug, since a later successful save never cleared it. It explained one oddity in the snapshot, not the timeout.

    Evidence for next time: playwright.config.ts now keeps a trace for every failing test (trace: 'retain-on-failure'). The next occurrence leaves test-results/**/trace.zip showing whether the departure waits on the layout load (/api/instance, /api/auth/session, /api/notices) or on the router.

    Keeping this open until a trace pins the cause.


    Generated by Claude Code

  2. added
    later
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    later

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions