Skip to content

test(workflows): replace polling sleeps with poll_until#153

Merged
pratyush618 merged 1 commit into
masterfrom
test/workflow-poll-sleeps
May 8, 2026
Merged

test(workflows): replace polling sleeps with poll_until#153
pratyush618 merged 1 commit into
masterfrom
test/workflow-poll-sleeps

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

Closes the workflow-test gap left open by #146. PR #146 explicitly skipped tests/workflows/ to avoid conflicting with #145's in-flight conftest changes; with both merged, the deferred 4 pollable sleeps can now use the poll_until fixture.

File Sleep Replacement
test_workflows_gates.py:30 time.sleep(3) # Let "a" complete poll_until on approve == WAITING_APPROVAL
test_workflows_gates.py:56 time.sleep(2) # Let "a" complete and gate enter WAITING_APPROVAL same
test_workflows_gates.py:80 time.sleep(2) same
test_workflows_fan_out.py:241 time.sleep(2) # Wait for source to complete and fan-out to expand poll_until on fetch == COMPLETED
test_workflows_subworkflow.py:143 time.sleep(2) # Let sub-workflow submit poll_until on sub == RUNNING

The two remaining time.sleep calls in slow_task/slow_process task bodies stay — they're intentional pacing (the test asserts the worker handles a slow task) — but they now have one-line comments explaining why so the next audit doesn't re-flag them.

This finishes audit recommendation 6.

Test plan

  • uv run python -m pytest tests/workflows/test_workflows_gates.py tests/workflows/test_workflows_fan_out.py tests/workflows/test_workflows_subworkflow.py — 22 passed.
  • uv run mypy py_src/taskito/ tests/ --no-incremental — clean.
  • uv run ruff check tests/workflows/ — clean.
  • CI runs the full suite.

@github-actions github-actions Bot added the tests label May 8, 2026
@pratyush618 pratyush618 merged commit 8e89c03 into master May 8, 2026
19 checks passed
@pratyush618 pratyush618 deleted the test/workflow-poll-sleeps branch May 8, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant