Repository navigation
Wait for the sender before checking its status in NotificationServiceTest - #634
Merged
Merged
Conversation
…Test Four tests wait only on the receiving workflow, then assert that both workflows are SUCCESS. The receiver can finish as soon as the sender's send step commits the message, before the sender records SUCCESS, so on a slow runner the sender was still PENDING. Each test now waits for the sender too. Fixes #633.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
All four waits address the reported race without changing production behavior or introducing identified issues.
No open issues 🎉
What changed in this PR
Fixes the test race reported in #633 by waiting for sender completion before checking workflow status.
Changes:
- Adds
handle2.getResult()to four notification tests. - Explains why receiver completion alone is insufficient.
- Leaves production code unchanged.
| File | Description |
|---|---|
transact/src/test/java/dev/dbos/transact/notifications/NotificationServiceTest.java |
Waits for sender completion before SUCCESS assertions in four tests. |
Review effort: Balanced
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.
Fixes #633.
Four tests in
NotificationServiceTest(basic_send_recvand three others with the same shape) wait only on the receiving workflow, then assert that both workflows are SUCCESS. The receiver can finish as soon as the sender'ssendstep commits the message, which is before the sender records SUCCESS. On a slow runner the sender was still PENDING, as in the On Push run for #632, where the failure skipped that commit's publish.Each test now calls
handle2.getResult()before the status asserts. This is a test-only change. The other tests that assert a second handle is SUCCESS (DynamicQueuesTest,StaticQueuesTest,ForkTest) already wait on it first.🤖 Generated with Claude Code