Merged
Conversation
The test had a race condition where `Cluster.Join()` was called but sharding was started immediately without waiting for the cluster to reach the Up state. Under CI load, the sharding coordinator singleton may not be elected in time, causing the `CurrentRegions` query to timeout. Changes: - Convert test to async pattern using AwaitAssertAsync - Add cluster Up state awaiting before starting sharding - Convert all sync ExpectMsg calls to async ExpectMsgAsync - Use WaitAsync instead of blocking Wait for system termination This follows the established pattern from Bugfix7399Specs which correctly awaits cluster state before sharding operations.
BugFix4376Spec: - Replace 80ms _delay timeout with AwaitAssertAsync pattern - Properly wait for router recovery instead of guessing timing - Affects RoundRobin/Random Pool and Group router tests HubSpec (BroadcastHub_must_handle_cancelled_Sink): - Add 100ms delay after attaching cancelled sink - Allows UnRegister event to complete before element delivery - Matches fix pattern from PR akkadotnet#7862 TimerSpec (Must_schedule_repeated_ticks): - Replace tight WithinAsync window with individual per-message timeouts - Avoids cumulative variance causing timeout under CI load ShardedDaemonProcessProxySpec: - Wrap proxy Ask loop in AwaitAssertAsync - Handles proxy registration timing with coordinator StreamTcpDocTests: - Await server binding before client connection - Use dynamic port instead of hardcoded 8888 - Add proper cleanup with Unbind() ParallelTestActorDeadlockSpec: - Reduce concurrent TestKits from 40 to 16 - Prevents shutdown cascade from saturating thread pool
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.
Summary
Fix flaky unit tests identified from CI failures across PRs #8014, #8012, #8011, #8006, #7993, #7990, #7971.
Fixes Applied
1. RememberEntitiesShardIdExtractorChangeSpec
AwaitAssertAsyncfor clusterUpstate before starting sharding2. BugFix4376Spec (RoundRobin/Random Pool & Group Routers)
AwaitAssertAsyncpattern3. HubSpec (BroadcastHub_must_handle_cancelled_Sink)
4. TimerSpec (Must_schedule_repeated_ticks)
5. ShardedDaemonProcessProxySpec
AwaitAssertAsync6. StreamTcpDocTests
7. ParallelTestActorDeadlockSpec
Still Pending (Require Human Decision)
DefaultCollector.cs(issue DefaultCollector: MemoryAvailable metric reports wrong value and fails on Windows CI #7803)Test Plan