Skip to content

ci: sleep budget guard for test code - #14820

Merged
TrapsterDK merged 2 commits into
mainfrom
tests/sleep-guard
Nov 24, 2026
Merged

TrapsterDK merged 2 commits into
mainfrom
tests/sleep-guard

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Adds //tools/ci:sleep_budget_test. It counts fixed sleeps in test code: sleep calls in Rust, Python, Go, Java, Erlang and Elixir, shell and PowerShell sleeps, sleep child processes and cmd timeout /t. Each test file keeps the count it has today in tools/ci/sleep_budget.txt. An unlisted file gets 0, there is no allowlist, and //tools/ci:sleep_budget_update only lowers the budget.

The budget comparison moves into dx_guard so the comment and sleep budgets share it. other_code.json now also carries .erl, .ex, .exs, .java and .kt files.

Works with #14818, which removes the harness sleeps.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus

//tools/ci:sleep_budget_test counts fixed sleeps in test code: thread,
tokio, Python, Go, Java, Erlang and Elixir sleep calls, shell and
PowerShell sleeps, sleep child processes and cmd timeouts. Test code is
any file under a tests, testing or fixtures directory or named like a
test, plus the cfg(test) items of other Rust files. Each file gets the
count it has today in tools/ci/sleep_budget.txt; an unlisted file gets
0, and sleep_budget_update only lowers the budget. There is no
allowlist.

The budget comparison moves from comment_budget into dx_guard so both
budgets share it, and other_code.json also carries .erl, .ex, .exs,
.java and .kt files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["linux_x86_64"] task=test scope=//tools/ci:sleep_budget_test //tools/ci:comment_budget_test //tools/ci:dx_guard_test //tools/ci:repo_rule_refetch_test

Command::new("/bin/sleep") and symlinks to /usr/bin/sleep start a fixed
sleep the same as a bare "sleep" argument, so they count too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hyBydsMejdwk6QdKus
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["linux_x86_64"] task=test scope=//tools/ci:sleep_budget_test //tools/ci:comment_budget_test //tools/ci:dx_guard_test //tools/ci:repo_rule_refetch_test

@TrapsterDK
TrapsterDK merged commit dcb7afb into main Nov 24, 2026
17 of 27 checks passed
@TrapsterDK
TrapsterDK deleted the tests/sleep-guard branch November 24, 2026 09:38
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