Skip to content

Commit 1b79d75

Browse files
committed
fix: increase wait() timeout for multi-message consumer tests
Tests that send multiple websocket messages before calling wait() can flake under CI load because the default 1-second timeout cancels the consumer task before all messages are processed. Add explicit timeout=TIMEOUT (5s) to the 5 multi-message tests only, matching the pattern already used for receive_json_from() in the same file. Single-message tests keep the default for fast failure detection. Assisted-by: Claude Opus
1 parent 9aba91d commit 1b79d75

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/integration/wsapi/test_consumer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ async def test_handle_actions_multiple_firing(
292292
)
293293
await ws_communicator.send_json_to(payload1)
294294
await ws_communicator.send_json_to(payload2)
295-
await ws_communicator.wait()
295+
await ws_communicator.wait(timeout=TIMEOUT)
296296

297297
assert (await get_audit_rule_count()) == 2
298298
assert (await get_audit_action_count()) == 2
@@ -394,7 +394,7 @@ async def test_rule_status_with_multiple_failed_actions(
394394
)
395395
await ws_communicator.send_json_to(action1)
396396
await ws_communicator.send_json_to(action2)
397-
await ws_communicator.wait()
397+
await ws_communicator.wait(timeout=TIMEOUT)
398398

399399
assert (await get_audit_action_count()) == 2
400400
assert (await get_audit_rule_count()) == 1
@@ -459,7 +459,7 @@ async def test_handle_heartbeat(
459459
for payload in payloads:
460460
await ws_communicator.send_json_to(payload)
461461

462-
await ws_communicator.wait()
462+
await ws_communicator.wait(timeout=TIMEOUT)
463463

464464
updated_rulebook_process = await get_rulebook_process(rulebook_process_id)
465465
assert (
@@ -517,7 +517,7 @@ async def test_handle_heartbeat_running_status(
517517
for payload in payloads:
518518
await ws_communicator.send_json_to(payload)
519519

520-
await ws_communicator.wait()
520+
await ws_communicator.wait(timeout=TIMEOUT)
521521

522522
activation = await monitor_activation(activation)
523523
assert activation.status == ActivationStatus.RUNNING
@@ -561,7 +561,7 @@ async def test_multiple_rules_for_one_event(
561561

562562
await ws_communicator.send_json_to(action1)
563563
await ws_communicator.send_json_to(action2)
564-
await ws_communicator.wait()
564+
await ws_communicator.wait(timeout=TIMEOUT)
565565

566566
assert (await get_audit_action_count()) == 2
567567
assert (await get_audit_rule_count()) == 2

0 commit comments

Comments
 (0)