@@ -179,6 +179,7 @@ async def run(self, data: TraceData) -> TraceData:
179179 data ,
180180 start_to_close_timeout = timedelta (seconds = 10 ),
181181 heartbeat_timeout = timedelta (seconds = 2 ),
182+ activity_id = "activity-id" ,
182183 )
183184 data = await workflow .execute_child_workflow (
184185 EchoWorkflow .run , data , id = f"{ workflow .info ().workflow_id } _child"
@@ -231,6 +232,7 @@ async def test_payload_conversion_calls_follow_expected_sequence_and_contexts(
231232 workflow_id = workflow_id ,
232233 workflow_type = PayloadConversionWorkflow .__name__ ,
233234 activity_type = passthrough_activity .__name__ ,
235+ activity_id = "activity-id" ,
234236 activity_task_queue = task_queue ,
235237 is_local = False ,
236238 )
@@ -328,6 +330,7 @@ async def run(self) -> TraceData:
328330 initial_interval = timedelta (milliseconds = 100 ),
329331 maximum_attempts = 2 ,
330332 ),
333+ activity_id = "activity-id" ,
331334 )
332335
333336
@@ -370,6 +373,7 @@ async def test_heartbeat_details_payload_conversion(client: Client):
370373 workflow_id = workflow_id ,
371374 workflow_type = HeartbeatDetailsSerializationContextTestWorkflow .__name__ ,
372375 activity_type = activity_with_heartbeat_details .__name__ ,
376+ activity_id = "activity-id" ,
373377 activity_task_queue = task_queue ,
374378 is_local = False ,
375379 )
@@ -419,6 +423,7 @@ async def run(self, data: TraceData) -> TraceData:
419423 local_activity ,
420424 data ,
421425 start_to_close_timeout = timedelta (seconds = 10 ),
426+ activity_id = "activity-id" ,
422427 )
423428
424429
@@ -459,6 +464,7 @@ async def test_local_activity_payload_conversion(client: Client):
459464 workflow_id = workflow_id ,
460465 workflow_type = LocalActivityWorkflow .__name__ ,
461466 activity_type = local_activity .__name__ ,
467+ activity_id = "activity-id" ,
462468 activity_task_queue = task_queue ,
463469 is_local = True ,
464470 )
@@ -504,7 +510,7 @@ async def test_local_activity_payload_conversion(client: Client):
504510
505511
506512@workflow .defn
507- class EventWorkflow :
513+ class WaitForSignalWorkflow :
508514 # Like a global asyncio.Event()
509515
510516 def __init__ (self ) -> None :
@@ -521,10 +527,11 @@ def signal(self) -> None:
521527
522528@activity .defn
523529async def async_activity () -> TraceData :
530+ # Notify test that the activity has started and is ready to be completed manually
524531 await (
525532 activity .client ()
526533 .get_workflow_handle ("activity-started-wf-id" )
527- .signal (EventWorkflow .signal )
534+ .signal (WaitForSignalWorkflow .signal )
528535 )
529536 activity .raise_complete_async ()
530537
@@ -558,7 +565,7 @@ async def test_async_activity_completion_payload_conversion(
558565 task_queue = task_queue ,
559566 workflows = [
560567 AsyncActivityCompletionSerializationContextTestWorkflow ,
561- EventWorkflow ,
568+ WaitForSignalWorkflow ,
562569 ],
563570 activities = [async_activity ],
564571 workflow_runner = UnsandboxedWorkflowRunner (), # so that we can use isinstance
@@ -572,12 +579,13 @@ async def test_async_activity_completion_payload_conversion(
572579 workflow_id = workflow_id ,
573580 workflow_type = AsyncActivityCompletionSerializationContextTestWorkflow .__name__ ,
574581 activity_type = async_activity .__name__ ,
582+ activity_id = "async-activity-id" ,
575583 activity_task_queue = task_queue ,
576584 is_local = False ,
577585 )
578586
579587 act_started_wf_handle = await client .start_workflow (
580- EventWorkflow .run ,
588+ WaitForSignalWorkflow .run ,
581589 id = "activity-started-wf-id" ,
582590 task_queue = task_queue ,
583591 )
@@ -644,6 +652,7 @@ def test_subclassed_async_activity_handle(client: Client):
644652 workflow_id = "workflow-id" ,
645653 workflow_type = "workflow-type" ,
646654 activity_type = "activity-type" ,
655+ activity_id = "activity-id" ,
647656 activity_task_queue = "activity-task-queue" ,
648657 is_local = False ,
649658 )
@@ -1058,11 +1067,12 @@ async def run(self) -> Never:
10581067 failing_activity ,
10591068 start_to_close_timeout = timedelta (seconds = 10 ),
10601069 retry_policy = RetryPolicy (maximum_attempts = 1 ),
1070+ activity_id = "activity-id" ,
10611071 )
10621072 raise Exception ("Unreachable" )
10631073
10641074
1065- test_traces : dict [str , list [TraceItem ]] = defaultdict (list )
1075+ test_traces : dict [Optional [ str ] , list [TraceItem ]] = defaultdict (list )
10661076
10671077
10681078class FailureConverterWithContext (DefaultFailureConverter , WithSerializationContext ):
@@ -1154,6 +1164,7 @@ async def test_failure_converter_with_context(client: Client):
11541164 workflow_id = workflow_id ,
11551165 workflow_type = FailureConverterTestWorkflow .__name__ ,
11561166 activity_type = failing_activity .__name__ ,
1167+ activity_id = "activity-id" ,
11571168 activity_task_queue = task_queue ,
11581169 is_local = False ,
11591170 )
@@ -1322,6 +1333,7 @@ async def run(self, data: str) -> str:
13221333 codec_test_local_activity ,
13231334 data ,
13241335 start_to_close_timeout = timedelta (seconds = 10 ),
1336+ activity_id = "activity-id" ,
13251337 )
13261338
13271339
@@ -1360,6 +1372,7 @@ async def test_local_activity_codec_with_context(client: Client):
13601372 workflow_id = workflow_id ,
13611373 workflow_type = LocalActivityCodecTestWorkflow .__name__ ,
13621374 activity_type = codec_test_local_activity .__name__ ,
1375+ activity_id = "activity-id" ,
13631376 activity_task_queue = task_queue ,
13641377 is_local = True ,
13651378 )
@@ -1593,6 +1606,7 @@ async def run(self, data: str) -> str:
15931606 payload_encryption_activity ,
15941607 "outbound" ,
15951608 start_to_close_timeout = timedelta (seconds = 10 ),
1609+ activity_id = "activity-id" ,
15961610 ),
15971611 workflow .execute_child_workflow (
15981612 PayloadEncryptionChildWorkflow .run ,
0 commit comments