Skip to content

Commit eec35a3

Browse files
committed
test: wait for scheduled bulk messages
Prevent notification bookkeeping from racing phone SENT events in the integration suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 068b4956-94f1-4bbf-af3f-809a3a53d43e
1 parent 5ebdc58 commit eec35a3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎tests/integration_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ func TestBulkSMS_CSV(t *testing.T) {
449449

450450
// Wait for FCM push
451451
waitForFCMPush(t, messageID, 30*time.Second)
452+
pollMessageStatus(ctx, t, messageID, "scheduled", 15*time.Second)
452453

453454
// Fire SENT event
454455
fireEvent(ctx, t, phone.PhoneAPIKey, messageID, "SENT")
@@ -537,6 +538,7 @@ func TestBulkSMS_Excel(t *testing.T) {
537538
msgID2 := bulkMessages[1].ID.String()
538539
waitForFCMPush(t, msgID1, 30*time.Second)
539540
waitForFCMPush(t, msgID2, 30*time.Second)
541+
pollMessageStatus(ctx, t, msgID1, "scheduled", 15*time.Second)
540542

541543
// Fire SENT then DELIVERED on message 1, leave message 2 pending
542544
fireEvent(ctx, t, phone.PhoneAPIKey, msgID1, "SENT")

0 commit comments

Comments
 (0)