Skip to content

Give manual activity tests time for the start handshake - #1832

Closed
DABH wants to merge 1 commit into
mainfrom
flake/manual-activity-timeouts
Closed

Give manual activity tests time for the start handshake#1832
DABH wants to merge 1 commit into
mainfrom
flake/manual-activity-timeouts

Conversation

@DABH

@DABH DABH commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What was changed

test_manual_completion, test_manual_cancellation, test_manual_failure and test_manual_heartbeat start their standalone activity with start_to_close_timeout=timedelta(minutes=1) instead of 5 seconds.

Why

tests/test_activity.py::test_manual_heartbeat failed on macOS CI (run 33848127955 attempt 2) with RPCError: activity not found for ID: <uuid> (NOT_FOUND) from the heartbeat-by-ID call.

These tests learn that the activity attempt is running through a handshake: the activity signals an EventWorkflow, the test waits for that workflow, then completes/cancels/fails/heartbeats the attempt by ID. The handshake includes the first workflow task of a freshly started worker. In the failing run the captured log shows the attempt starting at 08:00:57 and the handshake workflow completing at 08:01:02, so by the time the test heartbeated, the 5 second start-to-close timeout had already closed the attempt. Nothing in these tests relies on the attempt timing out; the bound only decides how slow a runner may be before the test breaks, so it is raised well above anything the per-test pytest timeout allows.

Testing

  • The four tests pass 40/40 each with --flake-finder -n 6 under CPU load (the handshake is too fast on a development machine to reproduce the CI timing).
  • poe lint clean.

test_manual_heartbeat and its siblings start a standalone activity with a
5s start-to-close timeout, then wait for the activity to report that it
started through an EventWorkflow before completing, cancelling, failing or
heartbeating it by ID. That handshake includes the first workflow task of a
cold worker, which on a loaded macOS runner took over 5s; the attempt timed
out and the heartbeat failed with RPCError NOT_FOUND ("activity not found
for ID"). Nothing in these tests depends on the attempt timing out, so give
the attempt a minute.
@DABH

DABH commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #1842, which now covers both the cancel-activity test and these manual activity tests under one rationale.

@DABH DABH closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant