Skip to content

test_slow_downlink: give the env-limit run enough steps after the window - #334

Merged
michaellchung merged 1 commit into
mainfrom
fix-slow-downlink-flaky
Nov 3, 2026
Merged

michaellchung merged 1 commit into
mainfrom
fix-slow-downlink-flaky

Conversation

@michaellchung

Copy link
Copy Markdown
Contributor

Problem

test_env_downlink_limit_makes_a_running_island_slow[forwarder] failed intermittently on CI with no merge with island 1 after the window.

The env downlink window opens at the first PULL for step 400 and lasts 14 s; the check needs a merge with island 1 after window end + 2 s. With a fixed --total-steps 1200 the time left after the window depends on the merge rate: about 7 s at 30 merges/s, but only about 2 s at the ~43 merges/s CI showed (260 merges in 6 s). In that 2 s island 1 must finish draining its forwarder backlog (~100 MB) and get a fresh-base push merged; on a slower runner the run ended first. The syncer behaved as designed (the drained line was logged, island 1 was never removed); the test's step budget was too small.

Shrinking the budget locally reproduces it deterministically: with 1000-1100 total steps every run fails (the run ends inside or right after the window).

Fix

start_syncer takes total_steps; the env test uses 1700 steps. Rounds are at least 20 ms apart (at most 50 merges/s), so the window ends by step 1100 and at least 12 s remain after it. Adds about 10 s to the test.

Verification

  • Both env-test variants: 60/60 runs passing (20 in parallel per batch, alongside 24 CPU burners).
  • Forwarder variant unloaded (fastest merge rate): 12/12 passing; island 1 merges again at +14.3 s and the run ends at +28.5 s.
  • tests/test_slow_downlink.py: 7 passed.

🤖 Generated with Claude Code

The env downlink window opens at step 400 and lasts 14 s; with 1200 total
steps the run could end about 2 s after the window at CI's merge rate,
before island 1 drained its forwarder backlog and was merged again, so the
"merge with island 1 after the window" check failed. The env test now runs
1700 steps, which leaves at least 12 s after the window even at the
syncer's maximum merge rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaellchung
michaellchung merged commit 5a76477 into main Nov 3, 2026
2 checks passed
@michaellchung
michaellchung deleted the fix-slow-downlink-flaky branch November 3, 2026 08: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.

1 participant