Skip to content

Commit f75b20e

Browse files
author
Bernd Verst
committed
Clarify that the queue-readiness helper returns a coroutine
The second element of the tuple returned by _start_manager_and_wait_for_queues is an already-created coroutine object, not a callable. Naming the local wait_for_queues made �wait wait_for_queues read like a missing call -- it misled an automated reviewer and would mislead a human too. Rename the local to queues_ready and say so in the docstring. No behavior change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 010b6832-802b-425d-957c-cf29b7143392
1 parent f9e679d commit f75b20e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎tests/durabletask/test_worker_concurrency_loop_async.py‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ async def run_test():
9898

9999

100100
def _start_manager_and_wait_for_queues(manager):
101-
"""Start the manager loop and wait until its queues are bound to this loop."""
101+
"""Start the manager loop and return an awaitable that resolves once its queues exist.
102+
103+
The second element of the returned tuple is an already-created coroutine
104+
object (a readiness awaitable), not a callable -- await it directly.
105+
"""
102106
worker_task = asyncio.create_task(manager.run())
103107

104108
async def wait_for_queues():
@@ -160,8 +164,8 @@ async def cancel_work(idx):
160164

161165
async def run_test():
162166
manager.prepare_for_run()
163-
worker_task, wait_for_queues = _start_manager_and_wait_for_queues(manager)
164-
await wait_for_queues
167+
worker_task, queues_ready = _start_manager_and_wait_for_queues(manager)
168+
await queues_ready
165169
assert manager.activity_queue is not None
166170
for i in range(total_items):
167171
manager.submit_activity(slow_work, cancel_work, i)
@@ -204,8 +208,8 @@ async def cancel_work(idx):
204208

205209
async def run_test():
206210
manager.prepare_for_run()
207-
worker_task, wait_for_queues = _start_manager_and_wait_for_queues(manager)
208-
await wait_for_queues
211+
worker_task, queues_ready = _start_manager_and_wait_for_queues(manager)
212+
await queues_ready
209213
queue = manager.activity_queue
210214
assert queue is not None
211215
original_task_done = queue.task_done

0 commit comments

Comments
 (0)