Repository navigation
Fix RememberEntitiesStarterSpec constant-strategy throttle test - #8361
Merged
Aaronontheweb merged 1 commit intoJul 10, 2026
Conversation
The constant entity-recovery test set retry-interval = 1s alongside the 2s constant-rate batch frequency, so at t=2s the no-ack retry timer and the batch timer fired in the same scheduler tick: the retry resent the just-dispatched, not-yet-acked batch and the duplicate StartEntity messages tripped the ExpectNoMsg(600ms) window. On the net6+ hashed wheel timer the tick ordering is consistent, turning the old flakiness into a deterministic local failure. Raise retry-interval above the recovery window (30s) so the retry never fires during the test, convert the test to async TestKit methods, and update the stale LocalFact skip reason - the production throttle was never at fault.
Aaronontheweb
deleted the
fix/remember-entities-starter-spec-constant-throttle
branch
July 10, 2026 22:03
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.
Changes
Fixes the deterministic local failure of
RememberEntitiesStarter_must_try_start_all_entities_in_a_throttled_way_with_entity_recovery_strategy_constant(skipped in CI via[LocalFact], but failed 100% of the time when run locally on Linux/net10.0).Root cause (test bug — production throttle is correct)
The test configured
retry-interval = 1s(theRememberEntityStarterno-ACK retry timer) alongsideentity-recovery-constant-rate-strategy.frequency = 2s(the batch timer). At t≈2s both periodic timers fire in the same scheduler tick:_waitingForAck.StartEntityAckreplies can reach the actor's mailbox — and resends the just-dispatched batch (OnRetryUnackedresends everything unacked, with no grace period).The duplicate
StartEntitymessages then trip the test'sExpectNoMsg(600ms)window (RememberEntitiesStarterSpec.cs:187):The actor's debug log shows the collision directly —
Starting batch of [2]andFound [2] remembered entities waiting for StartEntityAck, retryingat the same millisecond.This is not a recent regression: the production files are unchanged (
RememberEntityStarterlast touched in #7401), and the test has been broken since it was added in #5857 / CI-disabled in #6012. The net6+HashedWheelTimerSchedulerprocesses same-tick timers in consistent insertion order, which converted the old flaky failure into a deterministic one. DuplicateStartEntityis idempotent at the region, so the underlying behavior is harmless in production (shipped defaults dispatch batches ~20× faster than the retry interval).Fix
retry-intervalto30sso the no-ACK retry can never fire inside the ~4s recovery window, with a comment documenting the constraint. The test ACKs every entity immediately, so it never needs the retry.ExpectMsgAsync/ExpectNoMsgAsync/ExpectTerminatedAsync) per repo guidelines.LocalFactskip reason ("suspected bad code underneath" → the code was never at fault; the test stays local-only because its real-time 600msExpectNoMsgwindows remain CI-jitter-sensitive).No production code changes; no
BREAKING_CHANGES_V1.6.mdentry needed.Verification
Akka.Cluster.Sharding.Tests: 192/192 passed on net10.0/Release (previously 191/192).