Skip to content

spark-storage: keepalive test waits on deadlines, not fixed sleeps (intermittent CI failure) - #191

Open
AzeezIsh wants to merge 1 commit into
mainfrom
fix/keepalive-test-flake
Open

AzeezIsh wants to merge 1 commit into
mainfrom
fix/keepalive-test-flake

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

ngram_cache::keepalive::tests::ticks_only_while_active failed intermittently in CI's cargo test --workspace on 2026-10-18 (#182 once, #183 twice, #186 once). None of those PRs touch spark-storage, and each re-run passed. It always failed at the same assert (keepalive.rs:201, "touched: ticking"): after touch() the test gave the 2 ms ticker a fixed 30 ms to land a read, inside a 40 ms idle window.

Change: test only; no runtime code changes.

  • Keep touching until a read lands, bounded at 5 s.
  • Then stop touching and require the read count to hold still across a 200 ms span (5x the idle window), bounded at 5 s.

The test asserts the same three properties (no reads before a resolve, reads while touched, quiet after idle) without racing the scheduler.

On reproducing it: I could not reproduce the flake locally. The old test passed 100/100 on a 32-core Linux box with every core saturated, and 100/100 pinned to one CPU shared with six busy loops; the new test also passed 200/200 under both. So the CI failures most likely come from runner scheduling stalls (CPU steal, timer coarseness) that a dedicated box doesn't show. A filesystem fault is ruled out: a failed read stops the ticker permanently, which would fail every run, not intermittently.

🤖 Generated with Claude Code

…I flake)

ticks_only_while_active gave the ticker thread a fixed 30 ms after touch()
to land a read; on loaded CI runners it failed intermittently at the
"touched: ticking" assert (four PRs on 2026-10-18, none touching
spark-storage). Keep touching until a read lands (5 s bound), then stop and
require the count to hold still across 200 ms (5x the idle window, 5 s
bound). Same properties, no scheduling race.

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

This branch has not been deployed

No deployments
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