Skip to content

test: assert parallelism, not wall-clock, in concurrent workers - #17

Merged
jbutte merged 1 commit into
mainfrom
fix-flaky-concurrency-timing
Sep 17, 2026
Merged

jbutte merged 1 commit into
mainfrom
fix-flaky-concurrency-timing

Conversation

@jbutte

@jbutte jbutte commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

test_passing_suite spawns 5 workers across 5 spec files that each sleep 2s, then asserted the run finished in under 5 seconds — which conflates "the work overlapped" with "the runner was fast". It failed two of five matrix legs on its first CI run, at 5.02s and 5.19s.

Compares wall clock against the summed job time the queue already records instead. A serialized run takes at least as long as the sum, so the bound scales with runner speed rather than assuming it.

Verified both directions: parallel passes with ~2x headroom (5s vs 10s), and forcing a single worker still fails it (10.65s vs 10.03s). Raising the constant to 10 was the alternative, but 10s is the serial time, so it would have passed a fully serialized run.

refs DE-1818

🤖 Generated with Claude Code

test_passing_suite spawned 5 workers over 5 two-second spec files and
asserted the run finished in under 5 seconds. That conflates "the work
overlapped" with "the runner was fast": booting five rubies on a loaded
CI box eats the margin even when parallelism worked. It failed two of
five matrix legs on its first CI run, at 5.02s and 5.19s.

Compare wall clock against the summed job time the queue already
records instead. A serialized run takes at least as long as the sum, so
the bound scales with runner speed rather than assuming it. Verified
both ways: parallel passes with ~2x headroom (5s vs 10s), and forcing a
single worker still fails it (10.65s vs 10.03s).

Raising the constant to 10 was the alternative, but 10s is the serial
time, so it would have passed a fully serialized run.

refs DE-1818

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jbutte
jbutte merged commit 28638fa into main Sep 17, 2026
8 checks passed
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