Skip to content

Commit 8b5270d

Browse files
authored
Fix race condition in test_cancellation_type for TRY_CANCEL (#1475)
* fix race condition in test_cancellation_type for TRY_CANCEL * revert uv.lock
1 parent fb536f5 commit 8b5270d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/nexus/test_workflow_caller_cancellation_types_when_cancel_handler_fails.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ async def check_behavior_for_try_cancel(
298298
handler_wf: WorkflowHandle[Any, None],
299299
) -> None:
300300
await handler_wf.result()
301+
302+
cancel_request_failed = EventType.EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED
303+
async for event in caller_wf.fetch_history_events(wait_new_event=True):
304+
if event.event_type == cancel_request_failed:
305+
break
306+
301307
await caller_wf.signal(CallerWorkflow.release)
302308
result = await caller_wf.result()
303309
assert result.error_type == "NexusOperationError"

0 commit comments

Comments
 (0)