Skip to content

store: de-flake TestFileStoreTable timing windows#3789

Merged
asim merged 1 commit into
masterfrom
claude/loving-meitner-3Etoi
Jul 3, 2026
Merged

store: de-flake TestFileStoreTable timing windows#3789
asim merged 1 commit into
masterfrom
claude/loving-meitner-3Etoi

Conversation

@asim

@asim asim commented Jul 3, 2026

Copy link
Copy Markdown
Member

Problem

TestFileStoreTable (store package) failed intermittently on CI — run 28653768382, "Expected 2 items, got 1". It's a flaky test, not a regression: the identical commit (a356ab3) passed this Unit Tests job on the #3784 PR run and failed on the master-push run.

Root cause

The test writes records with a 100ms expiry, then immediately reads and expects them still present. Under -race on a loaded runner, the write loop + file I/O + read can take longer than 100ms, so a record expires before the "expect 2 / expect 1" read. It's a too-tight timing window — the store's expiry behavior itself is correct.

Fix

Widen the expiry/TTL windows (100ms → 1s) and the paired post-expiry sleeps (→ 2s). The "read before expiry" reads happen in well under 200ms, so they stay safely inside the 1s window on any runner; the "read after expiry" waits comfortably exceed it. Test-only.

Verification

go test -race -count=5 -run TestFileStoreTable ./store/ — green (the flake reproduced ~1-in-N before; repeated race runs now pass).

Note: this is the kind of failure the loop-triage backstop (#3714) now watches Run Tests for.

🤖 Generated with Claude Code


Generated by Claude Code

TestFileStoreTable failed intermittently on CI ("Expected 2 items, got 1"):
the same commit passed the Unit Tests job on a PR run and failed on the master
push. Cause: records written with a 100ms expiry are read back immediately and
expected to still be present, but under `-race` on a loaded runner the write
loop + file I/O + read can exceed 100ms, so a record expires before the read.

Widen the expiry/TTL windows (100ms -> 1s) and the paired post-expiry sleeps
(-> 2s). The "read before expiry" reads happen in well under 200ms, so they stay
inside the 1s window on any runner; the "read after expiry" waits comfortably
exceed it. Test-only; the store's expiry behavior is unchanged.

Verified: `go test -race -count=5 -run TestFileStoreTable ./store/` green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CmdEY7pYmV5zzwCjNJ4ykL
@asim asim merged commit 2889b98 into master Jul 3, 2026
10 checks passed
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.

2 participants