Repository navigation
fix(tests): refuse real sleeps in tests - #6317
Merged
Merged
Conversation
dan-petty
force-pushed
the
fix/4669-refuse-real-sleeps-in-tests
branch
4 times, most recently
from
November 18, 2026 18:18
5ffb700 to
d5c6c1c
Compare
No rule refused a real sleep in the test suite. An audit hook recorded 177 s of real sleep in 629 tests in 96 files. Direct calls stayed across src, and tests waiting on rate limits or process loops slept for real. Ban direct calls to time.sleep in src with the ruff TID251 banned-api table without per-file ignores. Route all direct waits in src through devops_cli.core.clock.sleep. Keep the single allowed call in src/devops_cli/core/clock.py under a reasoned noqa comment with its suppression ceiling recorded at 1. Add the real_sleep marker to pyproject.toml. Install a PEP 578 audit hook in tests/conftest.py for time.sleep, and fail tests that exceed the 0.25 s budget without the real_sleep mark. Update tests in tests/commands/test_pr_update.py to use clock: ClockFake, and mark child process wait tests with @pytest.mark.real_sleep. Closes #4669
dan-petty
force-pushed
the
fix/4669-refuse-real-sleeps-in-tests
branch
from
November 18, 2026 18:25
d5c6c1c to
32b85b6
Compare
dan-petty
marked this pull request as ready for review
November 18, 2026 18:34
dan-petty
pushed a commit
that referenced
this pull request
Nov 18, 2026
🤖 I have created a release *beep* *boop* --- ## [0.179.0](v0.178.0...v0.179.0) (2026-11-18) ### Features * **config:** Generate declared credentials from config set ([#6318](#6318)) ([abe8785](abe8785)) ### Bug Fixes * **roadmap:** judge the registry of the checked-out tree ([#6322](#6322)) ([31a15af](31a15af)) * **tests:** refuse real sleeps in tests ([#6317](#6317)) ([918c9f4](918c9f4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No rule refused a real sleep in the test suite. An audit hook recorded 177 s of real sleep in 629 tests in 96 files in the probed test suite. direct
time.sleepcalls stayed acrosssrc, and tests waiting on rate limits or process loops slept for real. Each second of real sleep delays pull request checks and wastes continuous integration compute.Closes #4669
Change:
openspec/changes/archive/2026-11-18-4669-refuse-real-sleeps-in-tests/