Skip to content

Commit ad5950f

Browse files
committed
fix(tests): raise sent/delivered poll timeout in rate-limit test to 30s
TestSendSMS_RateLimit failed intermittently in CI: fireEvent dispatches the SENT/DELIVERED cloud event through an async loopback HTTP push (emulatorPushQueue), and the 15s poll window was too tight under CI load, failing right at the boundary. Other tests already poll the 'delivered' status with a 30s timeout; align this test with that margin for both 'sent' and 'delivered' polls.
1 parent 31e6f3a commit ad5950f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tests/integration_test.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@ func TestSendSMS_RateLimit(t *testing.T) {
200200
assert.GreaterOrEqual(t, gapMs, int64(5500), "rate limit gap should be >= 5500ms (6s minus timing tolerance), got %dms", gapMs)
201201

202202
fireEvent(ctx, t, phone.PhoneAPIKey, msgID1, "SENT")
203-
pollMessageStatus(ctx, t, msgID1, "sent", 15*time.Second)
203+
pollMessageStatus(ctx, t, msgID1, "sent", 30*time.Second)
204204
fireEvent(ctx, t, phone.PhoneAPIKey, msgID2, "SENT")
205-
pollMessageStatus(ctx, t, msgID2, "sent", 15*time.Second)
205+
pollMessageStatus(ctx, t, msgID2, "sent", 30*time.Second)
206206
fireEvent(ctx, t, phone.PhoneAPIKey, msgID1, "DELIVERED")
207207
fireEvent(ctx, t, phone.PhoneAPIKey, msgID2, "DELIVERED")
208208

209-
msg1 := pollMessageStatus(ctx, t, msgID1, "delivered", 15*time.Second)
210-
msg2 := pollMessageStatus(ctx, t, msgID2, "delivered", 15*time.Second)
209+
msg1 := pollMessageStatus(ctx, t, msgID1, "delivered", 30*time.Second)
210+
msg2 := pollMessageStatus(ctx, t, msgID2, "delivered", 30*time.Second)
211211
assert.Equal(t, "delivered", msg1.Status)
212212
assert.Equal(t, "delivered", msg2.Status)
213213

0 commit comments

Comments
 (0)