Skip to content

test: fix flaky v7 paginated-listing test (#38) - seed across subdirectories#39

Merged
ehsan6sha merged 2 commits into
mainfrom
fix/38-flaky-v7-pagination-test
Jun 12, 2026
Merged

test: fix flaky v7 paginated-listing test (#38) - seed across subdirectories#39
ehsan6sha merged 2 commits into
mainfrom
fix/38-flaky-v7-pagination-test

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

Fixes #38 - full root-cause analysis on the issue. Test-only change; no shipped code is touched and no version bump is needed (the 0.6.9 artifacts are unaffected).

The single-directory seed put all 64 files in ONE salt-random shard (dir-local routing), so the >=2-page assertion rode an empty-tail-page artifact and failed whenever the salt routed /big to the LAST of the 16 shards (P=1/16 per run; ~1/10 measured locally; both of today's main pushes hit it while all PR runs passed). Latent since e98ad3d - unrelated to the 0.6.8/0.6.9 changes; the shipped pagination code always returned complete, correct page unions.

Fix: seed across 8 subdirectories (independent salt-random shards; collision probability 16^-7), and assert >=2 NON-EMPTY pages so the test proves real multi-shard pagination and can never again pass on the artifact.

Validation: 0 failures in 20 consecutive local runs (pre-fix: 1/10); full v7_hamt_tests target green.

Generated with Claude Code

ehsan6sha and others added 2 commits June 12, 2026 18:33
test_v7_list_directory_paginated_round_trips seeded 64 files in ONE
directory. Shard routing is dir-local (shard_for_path_v6 hashes the
parent dir), so all 64 landed in ONE salt-random shard and the >=2-page
assertion rode an artifact: page 2 was an empty tail drain of the
shards after the hot one. Whenever the salt routed /big to the LAST
shard (P = 1/16 per run) the cursor exhausted immediately, yielding a
single page and the panic: expected >=2 pages, got 1. Measured ~1/10
locally; failed both of today's main pushes while all PR runs passed
(luck). Latent since e98ad3d - NOT related to the 0.6.8/0.6.9 changes,
and not a bug in shipped pagination code (page unions were always
complete and correct).

Fix: seed the 64 files across 8 subdirectories of /big/ (8 each). Each
subdir routes to an independent salt-random shard, so the set spans
>=2 of the 16 shards unless all eight collide (P = 16^-7, never). The
test now also asserts >=2 NON-EMPTY pages, so it can never again pass
on the tail artifact - it finally tests real multi-shard pagination,
and stays valid if list_recursive_page later learns to skip trailing
empty shards (follow-up noted on #38).

Validation: 0 failures in 20 consecutive local runs (pre-fix: 1/10).

Fixes #38

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
test-rust runs cargo test --workspace --all-targets, but the workflow
path filters omitted the workspace-root tests/ directory - a PR
touching only tests/ (like the #38 flake fix itself) triggered NO CI
at all, so root-test changes merged unvalidated. Add tests/** to both
push and pull_request filters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ehsan6sha ehsan6sha merged commit cdade39 into main Jun 12, 2026
8 checks passed
@ehsan6sha ehsan6sha deleted the fix/38-flaky-v7-pagination-test branch June 12, 2026 22: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.

Flaky CI: v7 paginated-listing test fails ~6% of runs (single-dir seed never spans shards; >=2-page assertion rides an empty-tail artifact)

1 participant