Skip to content

Commit 27e51c0

Browse files
committed
Add brief comment, rename slow_task to waiting_task
The function never sleeps anymore — it waits on an Event() that's never set — so "slow" was misleading. waiting_task names what it actually does.
1 parent 2d5312c commit 27e51c0

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

tests/contrib/langgraph/e2e_functional_entrypoints.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ async def interrupt_entrypoint(value: str) -> dict:
133133

134134

135135
@task
136-
async def slow_task(x: int) -> int:
136+
async def waiting_task(x: int) -> int:
137+
# Wait (forever) until start_to_close_timeout or worker shutdown cancellation
137138
await asyncio.Event().wait()
138139
return x
139140

140141

141142
@entrypoint()
142143
async def slow_entrypoint(value: int) -> dict:
143-
result = await slow_task(value)
144+
result = await waiting_task(value)
144145
return {"result": result}

tests/contrib/langgraph/test_e2e_functional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
reset_task_execution_counts,
4747
simple_functional_entrypoint,
4848
slow_entrypoint,
49-
slow_task,
49+
waiting_task,
5050
step_1,
5151
step_2,
5252
step_3,
@@ -316,10 +316,10 @@ async def test_per_task_activity_options_override(self, client: Client) -> None:
316316
plugins=[
317317
LangGraphPlugin(
318318
entrypoints={"e2e_slow_functional": slow_entrypoint},
319-
tasks=[slow_task],
319+
tasks=[waiting_task],
320320
default_activity_options=_DEFAULT_ACTIVITY_OPTIONS,
321321
activity_options={
322-
"slow_task": {
322+
"waiting_task": {
323323
"execute_in": "activity",
324324
"start_to_close_timeout": timedelta(milliseconds=100),
325325
"retry_policy": RetryPolicy(maximum_attempts=1),

tests/contrib/langgraph/test_timeout.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class State(TypedDict):
1919

2020

2121
async def node(state: State) -> dict[str, str]: # pyright: ignore[reportUnusedParameter]
22+
# Wait (forever) until start_to_close_timeout or worker shutdown cancellation
2223
await asyncio.Event().wait()
2324
return {"value": "done"}
2425

0 commit comments

Comments
 (0)