Skip to content

Commit 6000b0d

Browse files
committed
Cleanup
1 parent 10bfedb commit 6000b0d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

tests/test_serialization_context.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,15 @@ async def activity_with_heartbeat_details() -> TraceData:
287287
"""Activity that checks heartbeat details are decoded with proper context."""
288288
info = activity.info()
289289

290-
# If we have heartbeat details, it means we're resuming from a previous attempt
291290
if info.heartbeat_details:
292-
# The heartbeat details should be a TraceData that was decoded with activity context
293291
assert len(info.heartbeat_details) == 1
294292
heartbeat_data = info.heartbeat_details[0]
295293
assert isinstance(heartbeat_data, TraceData)
296-
# Return the heartbeat data which should contain the decode trace
297294
return heartbeat_data
298295

299-
# First attempt - heartbeat and then fail
300296
data = TraceData()
301297
activity.heartbeat(data)
302-
# Wait a bit to ensure heartbeat is recorded
303298
await asyncio.sleep(0.1)
304-
# Fail to trigger retry with heartbeat details
305299
raise Exception("Intentional failure to test heartbeat details")
306300

307301

@@ -356,9 +350,6 @@ async def test_heartbeat_details_payload_conversion(client: Client):
356350
)
357351
)
358352

359-
# The result should contain the heartbeat data that was decoded with activity context
360-
# We expect to see the from_payload trace item for the heartbeat details
361-
# This test will FAIL until the bug is fixed
362353
found_heartbeat_decode = False
363354
for item in result.items:
364355
if item.method == "from_payload" and item.context == activity_context:
@@ -796,11 +787,9 @@ def __init__(self) -> None:
796787
@workflow.run
797788
async def run(self) -> TraceData:
798789
try:
799-
# Wait for signal
800790
await workflow.wait_condition(lambda: self.signal_received is not None)
801791
return self.signal_received or TraceData()
802792
except asyncio.CancelledError:
803-
# Return empty data on cancellation
804793
return TraceData()
805794

806795
@workflow.signal
@@ -812,7 +801,6 @@ async def external_signal(self, data: TraceData) -> None:
812801
class ExternalWorkflowSignaler:
813802
@workflow.run
814803
async def run(self, target_id: str, data: TraceData) -> TraceData:
815-
# Signal external workflow
816804
handle = workflow.get_external_workflow_handle(target_id)
817805
await handle.signal(ExternalWorkflowTarget.external_signal, data)
818806
return data
@@ -822,7 +810,6 @@ async def run(self, target_id: str, data: TraceData) -> TraceData:
822810
class ExternalWorkflowCanceller:
823811
@workflow.run
824812
async def run(self, target_id: str) -> TraceData:
825-
# Cancel external workflow
826813
handle = workflow.get_external_workflow_handle(target_id)
827814
await handle.cancel()
828815
return TraceData()
@@ -854,7 +841,6 @@ async def test_external_workflow_signal_and_cancel_payload_conversion(
854841
activities=[],
855842
workflow_runner=UnsandboxedWorkflowRunner(), # so that we can use isinstance
856843
):
857-
# Test external signal
858844
target_handle = await client.start_workflow(
859845
ExternalWorkflowTarget.run,
860846
id=target_workflow_id,
@@ -868,11 +854,9 @@ async def test_external_workflow_signal_and_cancel_payload_conversion(
868854
task_queue=task_queue,
869855
)
870856

871-
# Wait for both to complete
872857
signaler_result = await signaler_handle.result()
873858
await target_handle.result()
874859

875-
# Verify signal trace
876860
signaler_context = dataclasses.asdict(
877861
WorkflowSerializationContext(
878862
namespace="default",
@@ -886,8 +870,6 @@ async def test_external_workflow_signal_and_cancel_payload_conversion(
886870
)
887871
)
888872

889-
# This test verifies that external signals SHOULD use the target workflow's context
890-
# This is the DESIRED behavior to match .NET
891873
assert (
892874
signaler_result.items
893875
== [
@@ -914,9 +896,6 @@ async def test_external_workflow_signal_and_cancel_payload_conversion(
914896
]
915897
)
916898

917-
# Note: External cancel doesn't send payloads, so we don't test it here
918-
# The cancel context would only be used for failure deserialization
919-
920899

921900
# Failure conversion
922901

0 commit comments

Comments
 (0)