Skip to content

Commit b1865e0

Browse files
committed
Fix test and merge artifact
1 parent 399d8b1 commit b1865e0

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,14 +2780,10 @@ def _apply_schedule_command(
27802780
v.start_to_close_timeout.FromTimedelta(self._input.start_to_close_timeout)
27812781
if self._input.retry_policy:
27822782
self._input.retry_policy.apply_to_proto(v.retry_policy)
2783-
<<<<<<< Updated upstream
2784-
=======
2785-
print("Input summary:", self._input.summary)
27862783
if self._input.summary:
27872784
command.user_metadata.summary.CopyFrom(
27882785
self._instance._payload_converter.to_payload(self._input.summary)
27892786
)
2790-
>>>>>>> Stashed changes
27912787
v.cancellation_type = cast(
27922788
temporalio.bridge.proto.workflow_commands.ActivityCancellationType.ValueType,
27932789
int(self._input.cancellation_type),
@@ -2809,10 +2805,6 @@ def _apply_schedule_command(
28092805
command.schedule_activity.versioning_intent = (
28102806
self._input.versioning_intent._to_proto()
28112807
)
2812-
if self._input.summary:
2813-
command.user_metadata.summary.CopyFrom(
2814-
self._instance._payload_converter.to_payload(self._input.summary)
2815-
)
28162808
if self._input.priority:
28172809
command.schedule_activity.priority.CopyFrom(
28182810
self._input.priority._to_proto()

tests/test_client.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import uuid
66
from datetime import datetime, timedelta, timezone
7-
from typing import Any, List, Mapping, Optional, cast
7+
from typing import Any, List, Mapping, Optional, cast, Tuple
88
from unittest import mock
99

1010
import google.protobuf.any_pb2
@@ -94,7 +94,7 @@
9494
assert_eq_eventually,
9595
ensure_search_attributes_present,
9696
new_worker,
97-
worker_versioning_enabled,
97+
worker_versioning_enabled, assert_eventually,
9898
)
9999
from tests.helpers.worker import (
100100
ExternalWorker,
@@ -1510,7 +1510,7 @@ class LastCompletionResultWorkflow:
15101510
async def run(self) -> str:
15111511
last_result = workflow.get_last_completion_result(type_hint=str)
15121512
if last_result is not None:
1513-
return "From last completion:" + last_result
1513+
return "From last completion: " + last_result
15141514
else:
15151515
return "My First Result"
15161516

@@ -1534,11 +1534,20 @@ async def test_schedule_last_completion_result(
15341534
),
15351535
)
15361536
await handle.trigger()
1537-
await asyncio.sleep(1)
1537+
async def get_schedule_result() -> Tuple[int, Optional[str]]:
1538+
desc = await handle.describe()
1539+
length = len(desc.info.recent_actions)
1540+
if length == 0:
1541+
return length, None
1542+
else:
1543+
workflow_id = cast(ScheduleActionExecutionStartWorkflow, desc.info.recent_actions[-1].action).workflow_id
1544+
workflow_handle = client.get_workflow_handle(workflow_id)
1545+
result = await workflow_handle.result()
1546+
return length, result
1547+
1548+
assert await get_schedule_result() == (1, "My First Result")
15381549
await handle.trigger()
1539-
await asyncio.sleep(1)
1540-
print(await handle.describe())
1550+
assert await get_schedule_result() == (2, "From last completion: My First Result")
15411551

15421552
await handle.delete()
1543-
assert False
15441553

0 commit comments

Comments
 (0)