Skip to content

Commit e87f021

Browse files
committed
rename functions
1 parent 479ab13 commit e87f021

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

tests/helpers/__init__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,13 @@ async def get_pending_activity_info(
269269
_wait_for_pause_events: dict[str, threading.Event] = {}
270270

271271

272-
def wait_for_pause_release(activity_id: str) -> None:
273-
"""Block a sync activity until pause_and_assert releases it.
274-
275-
No-op if no event is registered: pause_and_assert may finish (and clean up
276-
the event) before the activity catches its cancel, since the server has
277-
already committed paused=true by the time pause_activity returns.
278-
"""
272+
def wait_for_pause_event(activity_id: str) -> None:
279273
event = _wait_for_pause_events.get(activity_id)
280274
if event is not None:
281275
event.wait()
282276

283277

284-
async def async_wait_for_pause_release(activity_id: str) -> None:
285-
"""Block an async activity until pause_and_assert releases it. No-op if not registered."""
278+
async def async_wait_for_pause_event(activity_id: str) -> None:
286279
event = _wait_for_pause_events.get(activity_id)
287280
if event is not None:
288281
await asyncio.get_running_loop().run_in_executor(None, event.wait)

tests/worker/test_workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@
130130
assert_pending_activity_exists_eventually,
131131
assert_task_fail_eventually,
132132
assert_workflow_exists_eventually,
133-
async_wait_for_pause_release,
133+
async_wait_for_pause_event,
134134
ensure_search_attributes_present,
135135
find_free_port,
136136
get_pending_activity_info,
137137
new_worker,
138138
pause_and_assert,
139139
unpause_and_assert,
140-
wait_for_pause_release,
140+
wait_for_pause_event,
141141
workflow_update_exists,
142142
)
143143
from tests.helpers.cache_eviction import (
@@ -7784,7 +7784,7 @@ async def heartbeat_activity(
77847784
except (CancelledError, asyncio.CancelledError) as err:
77857785
if not catch_err:
77867786
raise err
7787-
await async_wait_for_pause_release(activity.info().activity_id)
7787+
await async_wait_for_pause_event(activity.info().activity_id)
77887788
return activity.cancellation_details()
77897789
finally:
77907790
activity.heartbeat("finally-complete")
@@ -7804,7 +7804,7 @@ def sync_heartbeat_activity(
78047804
except (CancelledError, asyncio.CancelledError) as err:
78057805
if not catch_err:
78067806
raise err
7807-
wait_for_pause_release(activity.info().activity_id)
7807+
wait_for_pause_event(activity.info().activity_id)
78087808
return activity.cancellation_details()
78097809
finally:
78107810
activity.heartbeat("finally-complete")

0 commit comments

Comments
 (0)