Skip to content

Fix flaky ChannelTest select-until-done test - #565

Merged
adamw merged 1 commit into
masterfrom
fix-channel-select-test
Nov 30, 2026
Merged

adamw merged 1 commit into
masterfrom
fix-channel-select-test

Conversation

@adamw

@adamw adamw commented Nov 30, 2026

Copy link
Copy Markdown
Member

ChannelTest "select a receive until all channels are done" failed on master CI (JVM, Java 21, capacity 10000): it got 20 values and then Done, instead of 100 values and then Done.

Cause: selectOrClosed returns Done as soon as any channel is done. Each sender sends 10 values, sleeps 10ms, then marks its channel done. If the receiver is slowed down for more than 10ms (e.g. a busy CI machine), the first channel is done before the other channels are drained, so the select returns Done early. The test is old and not related to #529.

Fix: the test now only selects from channels that are not yet done, and stops once all of them are done. It still checks that all 100 values are received.

A 50ms pause in the receiver after 20 values reproduces the exact CI failure with the old test. The new test passes with it.

🤖 Generated with Claude Code

selectOrClosed returns Done as soon as any channel is done. The test
expected the receiver to drain all channels within the senders' 10ms
sleep. Now it stops selecting from channels that are done.
@adamw
adamw merged commit 801e6fb into master Nov 30, 2026
16 of 18 checks passed
@adamw
adamw deleted the fix-channel-select-test branch November 30, 2026 19:55
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