Repository navigation
Fix flaky ChannelTest select-until-done test - #565
Merged
Merged
Conversation
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.
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.
ChannelTest"select a receive until all channels are done" failed on master CI (JVM, Java 21, capacity 10000): it got 20 values and thenDone, instead of 100 values and thenDone.Cause:
selectOrClosedreturnsDoneas 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 returnsDoneearly. 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