fix: deflake //rs/p2p/state_sync_manager:state_sync_manager_integration_tests/test#9117
Closed
basvandijk wants to merge 1 commit intomasterfrom
Closed
fix: deflake //rs/p2p/state_sync_manager:state_sync_manager_integration_tests/test#9117basvandijk wants to merge 1 commit intomasterfrom
basvandijk wants to merge 1 commit intomasterfrom
Conversation
…on_tests/test Reduce the number of mini chunks in test_full_subnet_mini_chunks from 40,000 to 10,000 to fix flaky timeouts. Root cause: The test creates 40,000 tiny (1KB) chunks that must be synced across a simulated 13-node subnet with network latency (50ms + 30ms round-trip per hop). With 12 peers x 10 parallel downloads = 120 concurrent downloads and ~160ms round-trip per chunk, the theoretical minimum is ~53 seconds just for network latency, plus mutex contention, spawn_blocking overhead, and HTTP processing. The successful CI runs took ~112 seconds (out of a 120-second timeout), meaning any CI machine pressure caused timeouts. With 10,000 chunks (still 40x more than test_full_subnet's 250 chunks), the test completes in ~22 seconds with negligible variance, while still meaningfully testing the many-small-chunks code path.
Collaborator
Author
|
Closed in favour of #9123. |
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.
Root Cause
The
test_full_subnet_mini_chunkstest creates 40,000 tiny (1KB) chunks that must be synced across a simulated 13-node subnet with network latency (50ms + 30ms round-trip per hop). With 12 peers × 10 parallel downloads = 120 concurrent downloads and ~160ms round-trip per chunk, the theoretical minimum is ~53 seconds just for network latency, plus mutex contention,spawn_blockingoverhead, and HTTP processing.The successful CI runs took ~112 seconds (out of a 120-second timeout), meaning any CI machine pressure caused timeouts. All 13 flaky failures in the past week showed the same pattern:
test_full_subnet_mini_chunkstiming out at exactly 120 seconds.Fix
Reduce the number of mini chunks from 40,000 to 10,000. With 10,000 chunks (still 40× more than
test_full_subnet's 250 chunks), the test completes in ~22 seconds with negligible variance across 3 parallel runs, while still meaningfully testing the many-small-chunks code path.This PR was created following the steps in
.claude/skills/fix-flaky-tests/SKILL.md.