Skip to content

#207: the pause test asserts claiming stopped, not how fast a host is - #238

Merged
thedancingdeveloper merged 1 commit into
mainfrom
fix/pause-test-asserts-the-property
Aug 8, 2026
Merged

#207: the pause test asserts claiming stopped, not how fast a host is#238
thedancingdeveloper merged 1 commit into
mainfrom
fix/pause-test-asserts-the-property

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Contributor

Third build of the deployment image failed on test_pausing_a_project_stops_claiming_without_a_restartwork continued after the project was paused; assert 2 == 1.

Nothing was actually wrong. The test paused a project, slept 100ms, sampled, slept 150ms, and asserted the sample had not moved. An item already in flight when the pause landed finishes inside that window on a loaded machine and reads as a broken pause. The build host is a Docker-in-Docker worker under contention — precisely the machine that exposes it.

#207 already named the fix: the property worth protecting is that pausing stops claiming; the old assertion measured how fast an in-flight item finishes.

  • settle() waits for completions to stop changing instead of assuming a window — it tolerates a slow host rather than asserting against one.
  • queue.claim() is called directly while paused and must return None. That is the actual promise, with no timing assumption.
  • The queue must still hold pending work, so a drained backlog can no longer pass by proving nothing.

Ran six times on a deliberately contended machine without a flake. The resume half already waited on a condition and is unchanged.

Failing run: https://github.com/TheDancingDeveloper-org/agent-harness/actions/runs/31246983747

Third build of the deployment image failed here:

    FAILED tests/test_fleet.py::test_pausing_a_project_stops_claiming
    AssertionError: work continued after the project was paused
    assert 2 == 1

Nothing was wrong. The test paused a project, slept 100ms, sampled, slept
150ms and asserted the sample had not moved -- so an item already in flight
when the pause landed, finishing inside that window on a loaded machine, read
as "the pause did not work". The build host is a Docker-in-Docker worker under
contention, which is exactly the machine that exposes it.

#207 already named the fix: the property worth protecting is that pausing
stops *claiming*, and the old assertion measured how fast an in-flight item
finishes instead. So:

- `settle()` waits for completions to stop moving rather than assuming a
  window, which tolerates a slow host instead of asserting against it;
- `queue.claim()` is called directly while paused and must return None. That
  is the promise, tested with no timing assumption at all;
- the queue must still hold pending work, so a drained backlog can no longer
  pass by proving nothing.

Ran six times on a contended machine without a flake. The resume half already
waited on a condition and is unchanged.
@thedancingdeveloper
thedancingdeveloper merged commit 9837d19 into main Aug 8, 2026
3 checks passed
@thedancingdeveloper
thedancingdeveloper deleted the fix/pause-test-asserts-the-property branch August 8, 2026 08:15
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