test: fix flaky v7 paginated-listing test (#38) - seed across subdirectories#39
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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