From a8aff17099860442bbfe9c6087e91f85e90001c7 Mon Sep 17 00:00:00 2001 From: Brian Strauch Date: Wed, 22 Apr 2026 13:36:17 -0700 Subject: [PATCH 1/3] fix race condition in test_update_payload_conversion --- tests/test_serialization_context.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test_serialization_context.py b/tests/test_serialization_context.py index d3ce022f5..eb187fbbf 100644 --- a/tests/test_serialization_context.py +++ b/tests/test_serialization_context.py @@ -853,13 +853,13 @@ async def run(self, _pass_validation: bool) -> TraceData: @workflow.update def my_update(self, input: TraceData) -> TraceData: + self.input = input return input @my_update.validator def my_update_validator(self, input: TraceData) -> None: - self.input = input # for test purposes; update validators should not mutate workflow state if not self.pass_validation: - raise ValueError("Rejected") + raise ApplicationError("Rejected", input) @pytest.mark.parametrize("pass_validation", [True, False]) @@ -900,10 +900,12 @@ async def test_update_payload_conversion( UpdateSerializationContextTestWorkflow.my_update, TraceData() ) raise AssertionError("Expected WorkflowUpdateFailedError") - except WorkflowUpdateFailedError: - pass - - result = await wf_handle.result() + except WorkflowUpdateFailedError as e: + assert isinstance(e.cause, ApplicationError) + assert len(e.cause.details) == 1 + result = e.cause.details[0] + assert isinstance(result, TraceData) + await wf_handle.terminate() workflow_context = dataclasses.asdict( WorkflowSerializationContext( @@ -922,11 +924,11 @@ async def test_update_payload_conversion( ), TraceItem( method="to_payload", - context=workflow_context, # Outbound update/workflow result + context=workflow_context, # Outbound update result or rejection detail ), TraceItem( method="from_payload", - context=workflow_context, # Inbound update/workflow result + context=workflow_context, # Inbound update result or rejection detail ), ] From 1b3223f9e1f92b04e0c19c859bbd273711d7d783 Mon Sep 17 00:00:00 2001 From: Brian Strauch Date: Wed, 22 Apr 2026 14:06:22 -0700 Subject: [PATCH 2/3] improve comment --- tests/test_serialization_context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_serialization_context.py b/tests/test_serialization_context.py index eb187fbbf..8e8fcf048 100644 --- a/tests/test_serialization_context.py +++ b/tests/test_serialization_context.py @@ -924,11 +924,11 @@ async def test_update_payload_conversion( ), TraceItem( method="to_payload", - context=workflow_context, # Outbound update result or rejection detail + context=workflow_context, # Outbound update result or error detail ), TraceItem( method="from_payload", - context=workflow_context, # Inbound update result or rejection detail + context=workflow_context, # Inbound update result or error detail ), ] From 18332e6568c779140e878652b867b8593025ce19 Mon Sep 17 00:00:00 2001 From: Brian Strauch Date: Wed, 22 Apr 2026 16:54:42 -0700 Subject: [PATCH 3/3] trigger ci