Skip to content

Commit 614fedd

Browse files
authored
Wait for the sender before checking its status in NotificationServiceTest (#634)
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](https://claude.com/claude-code)
1 parent fdedb3a commit 614fedd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎transact/src/test/java/dev/dbos/transact/notifications/NotificationServiceTest.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ public void basic_send_recv() throws Exception {
187187

188188
String result = (String) handle1.getResult();
189189
assertEquals("HelloDBOS", result);
190+
// The receiver can finish as soon as the send step commits, before the sender records SUCCESS.
191+
handle2.getResult();
190192

191193
assertEquals(WorkflowState.SUCCESS, handle1.getStatus().status());
192194
assertEquals(WorkflowState.SUCCESS, handle2.getStatus().status());
@@ -271,6 +273,8 @@ public void notopic() throws Exception {
271273

272274
String result = (String) handle1.getResult();
273275
assertEquals("HelloDBOS", result);
276+
// The receiver can finish as soon as the send step commits, before the sender records SUCCESS.
277+
handle2.getResult();
274278

275279
assertEquals(WorkflowState.SUCCESS, handle1.getStatus().status());
276280
assertEquals(WorkflowState.SUCCESS, handle2.getStatus().status());
@@ -333,6 +337,8 @@ public void sendNull() throws Exception {
333337

334338
String result = (String) handle1.getResult();
335339
assertNull(result);
340+
// The receiver can finish as soon as the send step commits, before the sender records SUCCESS.
341+
handle2.getResult();
336342

337343
assertEquals(WorkflowState.SUCCESS, handle1.getStatus().status());
338344
assertEquals(WorkflowState.SUCCESS, handle2.getStatus().status());
@@ -422,6 +428,8 @@ public void recvSleep() throws Exception {
422428

423429
String result = (String) handle1.getResult();
424430
assertEquals("HelloDBOS", result);
431+
// The receiver can finish as soon as the send step commits, before the sender records SUCCESS.
432+
handle2.getResult();
425433

426434
assertEquals(WorkflowState.SUCCESS, handle1.getStatus().status());
427435
assertEquals(WorkflowState.SUCCESS, handle2.getStatus().status());

0 commit comments

Comments
 (0)