-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
harden ReliableDeliveryShardingSpecs #6750
harden ReliableDeliveryShardingSpecs #6750
Conversation
@@ -413,7 +413,7 @@ public async Task | |||
} | |||
|
|||
// redeliver also when no more messages are sent to the entity | |||
await consumerProbes[1].GracefulStop(RemainingOrDefault); | |||
Sys.Stop(consumerProbes[1]); // don't wait for termination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be the only fix this tests needs, FYI. No way to know for certain other than gathering more data.
@Arkatufus so we have a hard bug in the async TestKit here: akka.net/src/contrib/cluster/Akka.Cluster.Sharding.Tests/Delivery/ReliableDeliveryShardingSpec.cs Line 131 in 4f27bac
25 seconds is what we allot - it used to be 15 seconds prior to my last PR to harden this test (issue is: actors weren't being given enough time to complete the messaging routine.) Looking at the logs: First
Last
That's a grand total of 6 seconds - and there's several other asserts that happen between the 25 second one and the one prior. |
{ | ||
_log.Debug("End at [{0}]", job.SeqNr); | ||
EndReplyTo.Tell(new Collected(_processed.Select(c => c.Item1).ToImmutableHashSet(), _messageCount + 1)); | ||
Context.Stop(Self); | ||
} | ||
else if (EndCondition(job)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the figure - if the EndCondition
is satisfied before we've processed any messages, we're probably being recreated via the ProducerController<T>
+ ShardRegion
, therefore we want to ignore without sending anymore Collected
responses.
Changes
Fixes the following test race condition caused by forcing the test to wait until a probe gracefully stops, which can cause a re-delivery.