Skip to content

Fix EventSourcedBehaviorRetentionSpec non-determinism#2803

Open
He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin:port-retention-spec-nondeterminism
Open

Fix EventSourcedBehaviorRetentionSpec non-determinism#2803
He-Pin wants to merge 1 commit intoapache:mainfrom
He-Pin:port-retention-spec-nondeterminism

Conversation

@He-Pin
Copy link
Copy Markdown
Member

@He-Pin He-Pin commented Mar 28, 2026

Motivation

EventSourcedBehaviorRetentionSpec had a non-deterministic test failure where event ordering was not properly awaited before assertions.

Modification

Added expectNoMessage calls to ensure retention cycles complete before verifying results, eliminating race conditions in the test.

Result

Eliminates flaky test failures in EventSourcedBehaviorRetentionSpec.

References

  • Upstream commit: akka/akka-core@f38f8cce11, which is now Apache licensed.
  • Cherry-picked from akka/akka-core v2.8.0 (released March 2023, BSL -> Apache 2.0 after 3 years).

Notes

@He-Pin He-Pin marked this pull request as ready for review March 28, 2026 07:08
@He-Pin He-Pin added this to the 2.0.0-M2 milestone Mar 28, 2026
@He-Pin He-Pin force-pushed the port-retention-spec-nondeterminism branch from 1d821b9 to 0bd0ff3 Compare March 28, 2026 07:43
@He-Pin He-Pin force-pushed the port-retention-spec-nondeterminism branch from 0bd0ff3 to ff7dd0c Compare March 28, 2026 09:11
@He-Pin He-Pin requested review from Philippus and pjfanning March 28, 2026 09:47
Split the second batch of 10 increments into smaller batches (3+3+4)
with intermediate assertions after each batch. This ensures snapshot
and delete signals are observed in the expected order, preventing
flaky test failures caused by interleaving of async operations.

Upstream: akka/akka-core@f38f8cce11
Cherry-picked from akka/akka-core v2.8.0, which is now Apache licensed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@He-Pin He-Pin force-pushed the port-retention-spec-nondeterminism branch from ff7dd0c to 433bea0 Compare March 28, 2026 12:47
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