-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix: EventSourcedBehaviorStashSpec failure fixes #31808
fix: EventSourcedBehaviorStashSpec failure fixes #31808
Conversation
// a lot of events, so give it some extra time to complete | ||
val value1 = stateProbe.expectMessageType[State](10.seconds).value | ||
val value2 = stateProbe.expectMessageType[State](10.seconds).value | ||
val value3 = stateProbe.expectMessageType[State](10.seconds).value |
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 test case simply writes a lot of events, giving it more time fixed the issue
@@ -528,7 +529,7 @@ class EventSourcedBehaviorStashSpec | |||
} | |||
|
|||
trait StashLimit { | |||
val customStashLimit: Option[Int] = None | |||
def customStashLimit: Option[Int] |
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.
Just a little code-style-fix making it more clear what is going on
val c = spawn(behavior) | ||
|
||
// make sure it completed recovery, before we try to overfill the stash | ||
c ! "ping" | ||
probe.expectMessage("pong") | ||
|
||
c ! "start-stashing" | ||
probe.expectMessage("started-stashing") |
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.
These tests triggered started-stashing and then piled up messages without waiting for that to complete, so they end up in the non-explicit stash because of the write being in progress leading to the "unstash" message also having to be put in the stash buffer, which is at that point full.
Fixed by waiting for completion/response from the stash-state-toggle first.
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.
I would add this comment to the source code :)
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.
Added in ee983a6
val c = spawn(behavior) | ||
|
||
// make sure it completed recovery, before we try to overfill the stash | ||
c ! "ping" | ||
probe.expectMessage("pong") | ||
|
||
c ! "start-stashing" | ||
probe.expectMessage("started-stashing") |
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.
I would add this comment to the source code :)
References #31493
Could repeat the two different failures (and one more) by delaying completion of the in-mem journal writes some 20ms