Skip to content

Commit 3df2984

Browse files
committed
Give the cancel-activity asserts headroom over two task heartbeats
With a 5s task timeout the local-activity phases take two 80% heartbeat cycles, about 8s, before the cancel lands, so a 10s assert budget left under 2s of slack on loaded runners. Use 30s.
1 parent 63987ed commit 3df2984

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/worker/test_workflow.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,11 @@ def activity_result(self) -> str:
977977

978978
@pytest.mark.parametrize("local", [True, False])
979979
async def test_workflow_cancel_activity(client: Client, local: bool):
980-
# Core completes the task holding a local activity at 80% of this timeout
980+
# Core completes the task holding a local activity at 80% of this timeout, and
981+
# the cancel reaches the activity on the second such cycle (~8s), so the assert
982+
# budget needs headroom beyond that on loaded runners
981983
task_timeout = timedelta(seconds=5)
982-
assert_timeout = timedelta(seconds=10)
984+
assert_timeout = timedelta(seconds=30)
983985
activity_inst = ActivityWaitCancelNotify()
984986

985987
async def wait_cancel_complete() -> None:

0 commit comments

Comments
 (0)