Skip to content

Commit 935ae61

Browse files
committed
Revert unrelated lint fixes, removed the extra blank line causing error
1 parent ab51dfa commit 935ae61

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

temporalio/worker/_workflow_instance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,6 @@ async def operation_handle_fn() -> OutputT:
20702070
if self._cancel_requested:
20712071
raise
20722072

2073-
20742073
#### Miscellaneous helpers ####
20752074
# These are in alphabetical order.
20762075

tests/worker/test_workflow.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@
130130
assert_pending_activity_exists_eventually,
131131
assert_task_fail_eventually,
132132
assert_workflow_exists_eventually,
133+
async_wait_for_pause_event,
133134
ensure_search_attributes_present,
134135
find_free_port,
135136
get_pending_activity_info,
136137
new_worker,
137138
pause_and_assert,
138139
unpause_and_assert,
140+
wait_for_pause_event,
139141
workflow_update_exists,
140142
)
141143
from tests.helpers.cache_eviction import (
@@ -943,7 +945,7 @@ async def run(self, params: CancelActivityWorkflowParams) -> None:
943945
self._activity_result = await handle
944946
except ActivityError as err:
945947
self._activity_result = f"Error: {err.cause.__class__.__name__}"
946-
# TODO(cretz): Remove when https://github.com/temporalio/sdk-core/issues/323 is fixed
948+
# TODO(cretz): Remove when https://github.com/temporalio/sdk-rust/issues/323 is fixed
947949
except CancelledError as err:
948950
self._activity_result = f"Error: {err.__class__.__name__}"
949951
# Wait forever
@@ -2479,7 +2481,7 @@ async def test_workflow_dataclass_typed(client: Client, env: WorkflowEnvironment
24792481
# TODO(cretz): Fix
24802482
if env.supports_time_skipping:
24812483
pytest.skip(
2482-
"Java test server: https://github.com/temporalio/sdk-core/issues/390"
2484+
"Java test server: https://github.com/temporalio/sdk-rust/issues/390"
24832485
)
24842486
async with new_worker(
24852487
client, DataClassTypedWorkflow, activities=[data_class_typed_activity]
@@ -7295,7 +7297,7 @@ async def test_workflow_deadlock_interruptible(client: Client):
72957297
# TODO(cretz): Improve this test and other deadlock/eviction tests by
72967298
# checking slot counts with Core. There are a couple of bugs where used slot
72977299
# counts are off by one and slots are released before eviction (see
7298-
# https://github.com/temporalio/sdk-core/issues/894).
7300+
# https://github.com/temporalio/sdk-rust/issues/894).
72997301

73007302
# This worker used to not be able to shutdown because we hung evictions on
73017303
# deadlock
@@ -7744,7 +7746,7 @@ async def test_activity_benign_error_not_logged(client: Client):
77447746
assert isinstance(err.value.cause.cause, ApplicationError)
77457747
# Assert the expected category
77467748
assert err.value.cause.cause.category == ApplicationErrorCategory.BENIGN
7747-
assert capturer.find_log("Completing activity as failed") is None
7749+
assert capturer.find_log("Completing activity as failed") == None
77487750

77497751
# Run with non-benign error
77507752
with pytest.raises(WorkflowFailureError) as err:
@@ -7762,7 +7764,7 @@ async def test_activity_benign_error_not_logged(client: Client):
77627764
assert (
77637765
err.value.cause.cause.category == ApplicationErrorCategory.UNSPECIFIED
77647766
)
7765-
assert capturer.find_log("Completing activity as failed") is not None
7767+
assert capturer.find_log("Completing activity as failed") != None
77667768

77677769

77687770
async def test_workflow_missing_local_activity(client: Client):
@@ -7831,6 +7833,7 @@ async def heartbeat_activity(
78317833
except (CancelledError, asyncio.CancelledError) as err:
78327834
if not catch_err:
78337835
raise err
7836+
await async_wait_for_pause_event(activity.info().activity_id)
78347837
return activity.cancellation_details()
78357838
finally:
78367839
activity.heartbeat("finally-complete")
@@ -7850,6 +7853,7 @@ def sync_heartbeat_activity(
78507853
except (CancelledError, asyncio.CancelledError) as err:
78517854
if not catch_err:
78527855
raise err
7856+
wait_for_pause_event(activity.info().activity_id)
78537857
return activity.cancellation_details()
78547858
finally:
78557859
activity.heartbeat("finally-complete")
@@ -8040,8 +8044,8 @@ async def check_heartbeat_details_exist(
80408044

80418045
# Check workflow complete
80428046
result = await handle.result()
8043-
assert result[0] is None
8044-
assert result[1] is None
8047+
assert result[0] == None
8048+
assert result[1] == None
80458049

80468050

80478051
@activity.defn

0 commit comments

Comments
 (0)