Skip to content

Wait for the sender before checking its status in NotificationServiceTest - #634

Merged
devhawk merged 1 commit into
mainfrom
fix-notification-send-recv-race
Oct 20, 2026
Merged

devhawk merged 1 commit into
mainfrom
fix-notification-send-recv-race

Conversation

@devhawk

@devhawk devhawk commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes #633.

Four tests in NotificationServiceTest (basic_send_recv and 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's send step 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

…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.
@devhawk
devhawk requested review from kraftp, maxdml and qianl15 and a balanced review from Copilot October 20, 2026 20:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@devhawk
devhawk merged commit 614fedd into main Oct 20, 2026
13 checks passed
@devhawk
devhawk deleted the fix-notification-send-recv-race branch October 20, 2026 21:22
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.

NotificationServiceTest.basic_send_recv checks the sender's status without waiting for it

2 participants