Skip to content

test(app): wait for gated WAL index save instead of a fixed delay - #25796

Merged
kodjima33 merged 1 commit into
mainfrom
issues-improver/25789-wal-custody-save-flake
Nov 19, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
issues-improver/25789-wal-custody-save-flake

Conversation

@kodjima33

@kodjima33 kodjima33 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

What

app/test/unit/local_wal_live_custody_test.dart (#20376 case) waited a fixed 60 ms after sync.stop() and then asserted the gated index save had started (saves == 1). On a loaded runner it had not: the Dart Far Timezones job on main failed with Expected: <1> Actual: <0> at line 228 (run 44525641068, sha b23049e). The next five main runs passed on the same code, so this is a timing flake, not a product regression.

Fix

Test-only. persistWals completes a saveEntered completer when it is entered; the test awaits it (10 s timeout) before the existing pump and assertions. The "no ADVANCE before the index save" check still runs while the save is gated. No app code changes.

Tested

  • TZ=Pacific/Kiritimati flutter test test/unit/local_wal_live_custody_test.dart (Flutter 3.44.5): 9/9 pass.
  • Ran it 3 more times with 10 busy CPU loops in the background: 9/9 each time.
  • scripts/pr-preflight run locally.

Failure-Class: none

Auto-generated from issue feedback by the mini issues-improver — tested and merged.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

The #20376 custody test assumed sync.stop() reaches persistWals within a
60ms pump. On a loaded runner (Dart Far Timezones, run 44525641068) it had
not, so saves was 0. Await a completer set when the save is entered.

fixes #25789
@kodjima33
kodjima33 merged commit f2f660e into main Nov 19, 2026
50 of 52 checks passed
@kodjima33
kodjima33 deleted the issues-improver/25789-wal-custody-save-flake branch November 19, 2026 16:46
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