Skip to content

Fix flaky test caused by async WAL writes#3063

Merged
masih merged 1 commit intomainfrom
masih/fix-flake-flat-kv
Mar 12, 2026
Merged

Fix flaky test caused by async WAL writes#3063
masih merged 1 commit intomainfrom
masih/fix-flake-flat-kv

Conversation

@masih
Copy link
Collaborator

@masih masih commented Mar 12, 2026

TestReadOnlyLoadVersionSoftFailsWhenFlatKVUnavailable was intermittently failing because the default config uses asynchronous WAL writes. After Commit(), the test immediately opens a new WAL reader via LoadVersion() — but if the background write hasn't flushed yet, the reader sees an empty log and the store loads without any trees, causing a nil assertion failure. The race detector makes this much more likely by slowing goroutine scheduling.

Set AsyncCommitBuffer = 0 for this test so writes are synchronous . The test isn't exercising async behavior: it's testing the soft-fail path when FlatKV is unavailable.

Flaked on main.

`TestReadOnlyLoadVersionSoftFailsWhenFlatKVUnavailable` was
intermittently failing because the default config uses asynchronous WAL
writes. After `Commit()`, the test immediately opens a new WAL reader
via `LoadVersion()` — but if the background write hasn't flushed yet,
the reader sees an empty log and the store loads without any trees,
causing a nil assertion failure. The race detector makes this much more
likely by slowing goroutine scheduling.

Set `AsyncCommitBuffer = 0` for this test so writes are synchronous
. The test isn't exercising async behavior: it's testing the soft-fail
path when FlatKV is unavailable.
@github-actions
Copy link

github-actions bot commented Mar 12, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 12, 2026, 9:15 PM

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.27%. Comparing base (904de28) to head (0049761).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3063   +/-   ##
=======================================
  Coverage   58.27%   58.27%           
=======================================
  Files        2076     2076           
  Lines      171480   171480           
=======================================
  Hits        99933    99933           
  Misses      62619    62619           
  Partials     8928     8928           
Flag Coverage Δ
sei-chain-pr 42.00% <ø> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 72eaaa5 Mar 12, 2026
40 of 41 checks passed
@masih masih deleted the masih/fix-flake-flat-kv branch March 12, 2026 22:16
yzang2019 added a commit that referenced this pull request Mar 13, 2026
* main:
  feat(flatkv): add comprehensive writing test coverage and centralize account-field semantics (#3057)
  Fix flaky test caused by async WAL writes (#3063)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants