Skip to content

Commit 840b2f1

Browse files
committed
Fix flaky tests
1 parent 84c4291 commit 840b2f1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/durabletask/test_orchestration_async_e2e.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ def orchestrator(ctx: task.OrchestrationContext, _):
128128
assert state is not None
129129
assert state.runtime_status == client.OrchestrationStatus.SUSPENDED
130130

131+
# Small delay to ensure the suspension is fully enforced
132+
await asyncio.sleep(1)
133+
131134
# Raise an event and confirm that it does NOT complete while suspended
132135
await c.raise_orchestration_event(id, "my_event", data=42)
133136
try:
134-
state = await c.wait_for_orchestration_completion(id, timeout=3)
137+
state = await c.wait_for_orchestration_completion(id, timeout=5)
135138
assert False, "Orchestration should not have completed"
136139
except TimeoutError:
137140
pass

tests/durabletask/test_orchestration_e2e.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,13 @@ def orchestrator(ctx: task.OrchestrationContext, _):
269269
assert state is not None
270270
assert state.runtime_status == client.OrchestrationStatus.SUSPENDED
271271

272+
# Small delay to ensure the suspension is fully enforced
273+
time.sleep(1)
274+
272275
# Raise an event to the orchestration and confirm that it does NOT complete
273276
task_hub_client.raise_orchestration_event(id, "my_event", data=42)
274277
try:
275-
state = task_hub_client.wait_for_orchestration_completion(id, timeout=3)
278+
state = task_hub_client.wait_for_orchestration_completion(id, timeout=5)
276279
assert False, "Orchestration should not have completed"
277280
except TimeoutError:
278281
pass

0 commit comments

Comments
 (0)