Skip to content

Commit 39dac3c

Browse files
committed
Use workflow.now() for op future resolution time
1 parent 5f03401 commit 39dac3c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/nexus/test_workflow_caller_cancellation_types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ async def run(self, input: Input) -> CancellationResult:
189189
try:
190190
await op_handle
191191
except exceptions.NexusOperationError:
192-
test_context.caller_op_future_resolved.set_result(
193-
datetime.now(timezone.utc)
194-
)
192+
test_context.caller_op_future_resolved.set_result(workflow.now())
195193
assert op_handle.operation_token
196194
if input.cancellation_type in [
197195
workflow.NexusOperationCancellationType.TRY_CANCEL,

tests/nexus/test_workflow_caller_cancellation_types_when_cancel_handler_fails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async def run(self, input: Input) -> CancellationResult:
185185
error_type = err.__class__.__name__
186186
error_cause_type = err.__cause__.__class__.__name__
187187

188-
test_context.caller_op_future_resolved.set_result(datetime.now(timezone.utc))
188+
test_context.caller_op_future_resolved.set_result(workflow.now())
189189
assert op_handle.operation_token
190190
await workflow.wait_condition(lambda: self.released)
191191
return CancellationResult(

0 commit comments

Comments
 (0)