Skip to content

Commit

Permalink
Rename workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jul 17, 2024
1 parent ed50954 commit 72fdcc1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5604,7 +5604,7 @@ class UseLockOrSemaphoreWorkflowParameters:


@workflow.defn
class CoroutinesUseLockWorkflow:
class CoroutinesUseLockOrSemaphoreWorkflow:
def __init__(self) -> None:
self.params: UseLockOrSemaphoreWorkflowParameters
self.lock_or_semaphore: Union[asyncio.Lock, asyncio.Semaphore]
Expand Down Expand Up @@ -5674,7 +5674,7 @@ def _exits_critical_section(self, id: str) -> None:


@workflow.defn
class HandlerCoroutinesUseLockWorkflow(CoroutinesUseLockWorkflow):
class HandlerCoroutinesUseLockOrSemaphoreWorkflow(CoroutinesUseLockOrSemaphoreWorkflow):
def __init__(self) -> None:
super().__init__()
self.workflow_may_exit = False
Expand Down Expand Up @@ -5710,11 +5710,11 @@ async def _do_workflow_coroutines_lock_or_semaphore_test(
):
async with new_worker(
client,
CoroutinesUseLockWorkflow,
CoroutinesUseLockOrSemaphoreWorkflow,
activities=[noop_activity_for_lock_or_semaphore_tests],
) as worker:
summary = await client.execute_workflow(
CoroutinesUseLockWorkflow.run,
CoroutinesUseLockOrSemaphoreWorkflow.run,
arg=params,
id=str(uuid.uuid4()),
task_queue=worker.task_queue,
Expand All @@ -5736,7 +5736,7 @@ async def _do_update_handler_lock_or_semaphore_test(

task_queue = "tq"
handle = await client.start_workflow(
HandlerCoroutinesUseLockWorkflow.run,
HandlerCoroutinesUseLockOrSemaphoreWorkflow.run,
id=f"wf-{str(uuid.uuid4())}",
task_queue=task_queue,
)
Expand All @@ -5745,21 +5745,21 @@ async def _do_update_handler_lock_or_semaphore_test(
await admitted_update_task(
client,
handle,
HandlerCoroutinesUseLockWorkflow.my_update,
HandlerCoroutinesUseLockOrSemaphoreWorkflow.my_update,
arg=params,
id=f"update-{i}",
)
for i in range(n_updates)
]
async with new_worker(
client,
HandlerCoroutinesUseLockWorkflow,
HandlerCoroutinesUseLockOrSemaphoreWorkflow,
activities=[noop_activity_for_lock_or_semaphore_tests],
task_queue=task_queue,
):
for update_task in admitted_updates:
await update_task
await handle.signal(HandlerCoroutinesUseLockWorkflow.finish)
await handle.signal(HandlerCoroutinesUseLockOrSemaphoreWorkflow.finish)
summary = await handle.result()
assert summary == expectation

Expand Down

0 comments on commit 72fdcc1

Please sign in to comment.