Skip to content

ci: fail a test step that exceeds its wall-clock budget - #12938

Merged
cv merged 2 commits into
v1from
ci/test-budgets
Oct 9, 2026
Merged

cv merged 2 commits into
v1from
ci/test-budgets

Conversation

@cv

@cv cv commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Part of #12877 and #12876.

Failure

The timing report from #12885 showed where test time went, but nothing stopped it growing. A slower test passed CI as long as it passed.

Decision

  • Budgets file: .config/test-budgets.yaml records a wall-clock budget for the test step and for each lifecycle partition, and a limit for any one test in them.
  • Comparison: after each step, cargo ci compares the step's JUnit report with its budget. The budget and any offenders are added to the timing report, which is printed and goes to the job summary.
  • Enforcement: on the Linux GitHub runners the budgets were measured on, a step over budget fails. It names its wall time and every test over the limit. Other platforms and local runs report the budget without failing.
  • First budgets: these pass today with headroom. They come from the latest v1 run on linux_amd64, which already includes test: split tests into layers with wall-clock budgets #12885 and test: keep one system lifecycle per drift kind #12906.
Step Measured Budget
test 27 s wall, slowest test 5.1 s 45 s wall, 8 s per test
lifecycle, each partition up to 270 s wall, slowest test 149 s 360 s wall, 180 s per test
  • Live suites: the live suites have no budget yet; they report as before.
  • Docs: docs/contributing/testing.md says to lower a budget when a step gets faster, and to explain any increase in the pull request.

#12876 proposed 120 s per system scenario. remote_service::managed_bearer_credentials_survive_export_reapply_and_destroy takes 149 s, so the lifecycle limit can drop to 120 s once that test is split or shortened.

Validation

  • New test: parses budgets, lists a run's wall time and each test over the limit, rejects invalid budgets, and checks that the repository's budgets cover both steps. It failed before Budgets existed.
  • Local run: cargo ci test reports Budget: 45 s wall, 8 s per test (reported only; …) and Within budget..
  • Checks: nemoclaw-build integration tests pass. clippy at -D warnings passes with and without default features, and fmt is clean.
  • Pending: this PR's CI shows the enforced budget on the Linux runners.

The timing report showed where test time went, but nothing stopped it
growing: a slower test passed CI as long as it passed.

.config/test-budgets.yaml records a wall-clock budget for the test step
and for each lifecycle partition, and a limit for any one test in them.
After each step, cargo ci compares the JUnit report with the step's
budget and adds the result to the timing report. On the Linux GitHub
runners the budgets were measured on, a step over budget fails and names
its wall time and every test over the limit; other platforms and local
runs report the budget without failing.

The first budgets pass today with headroom: the test step takes 27 s on
linux_amd64 with a slowest test of 5.1 s, and each lifecycle partition
up to 270 s with a slowest test of 149 s.

Part of #12877.
@cv cv added area: ci CI workflows, checks, release automation, or GitHub Actions v1 NemoClaw v1 branch labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 8ca6da3 into v1 Oct 9, 2026
@cv
cv deleted the ci/test-budgets branch October 9, 2026 21:32
cv added a commit that referenced this pull request Oct 10, 2026
…suites (#12964)

Part of #12877; the parts still open after #12938.

## Failure

- Each platform's lifecycle suite runs in two partitions, and each
partition reports only its own tests, so no report shows a platform's
whole lifecycle suite.
- Live / Docker and Live / Kind had no budgets.
- `cargo ci live-docker` runs four nextest commands (the shared tests,
then each gateway test with its own document). Each command rewrote
`live-docker.xml`, so the step's timing report and its uploaded artifact
showed only the last command's single test. In the 11 most recent v1
runs, the artifact reports 3–7 s; the four commands took 210–255 s
together.

## Decision

- `nemoclaw-build lifecycle-timing DIR --platform P --shards '[1, 2]'`
reads the downloaded `lifecycle-P-SHARD-ATTEMPT` artifacts. It uses each
shard's latest attempt, names any shard without a report, and prints one
report: a partition table, then the existing module and slowest-test
tables over all tests. Partitions run in parallel, so the wall time is
the slowest partition's.
- A new `Lifecycle timing` job in `native-platform.yml` runs that
command after the lifecycle shards and writes the report to its job
summary. It runs on the platform's runner and takes the build tool from
the existing lifecycle-inputs artifact, so it compiles nothing. It is
`continue-on-error`, so a reporting problem cannot fail `Test /
PLATFORM`. I put it here instead of the `Test / PLATFORM` gate job in
`rust.yml`: the gate runs on Linux and has no build tool for the other
platforms. Using it would mean compiling the tool inside a required
check that has a 5-minute timeout.
- Each partition keeps reporting and enforcing its own budget; the
combined report enforces nothing.
- The live-docker step now saves each nextest command's JUnit report and
joins them (`ci::timing::join_consecutive`, run time summed), whether or
not the tests pass.
- `.config/test-budgets.yaml` adds budgets for the two live suites.
Since #12962, they run as the `Live / Docker` and `Live / Kind` jobs in
`native-platform.yml`, still through `cargo ci live-docker` and `cargo
ci live-kind`. `cargo ci` already enforces a budget for every step it
finds in the file, on Linux CI runners. A new test checks that every
step that writes a JUnit report has a budget.
- `live-kind`: 270 s wall, 120 s per test. In 11 v1 runs: at most 199 s
wall on linux_amd64 and 171 s on linux_arm64; slowest test 83 s.
- `live-docker`: 360 s wall, 180 s per test. In the same v1 runs, the
four commands together took at most 255 s on linux_amd64 and 210 s on
linux_arm64. The v1 JUnit kept only the last command's test. This PR's
run reports all 10 tests: 222 s wall on linux_amd64 and 197 s on
linux_arm64. Its slowest test,
`retained_runtime_rebuilds_offline_without_protobuf_or_a_dependency_cache`,
took 110 s and 101 s. In v1 logs, that test ran past 120 s in 5 of 11
linux_amd64 runs. Subtracting the other six tests in its command (about
70 s here) from that command's v1 wall time (at most 218 s) puts it
under about 150 s. That figure is an estimate, not a measurement.
- `docs/contributing/testing.md` describes the combined report and lists
the budgets, including the 120 s lifecycle limit from #12965.

## Validation

- New tests in `crates/nemoclaw-build/tests/ci.rs`: joining consecutive
JUnit reports, and the partitioned report (latest attempt, other
platforms ignored, missing shard named, parse errors naming the
artifact). The budget-coverage test failed on `live-docker has no
budget` before the budgets were added.
- `cargo test -p nemoclaw-build --no-default-features --test integration
-- ci::`, `cargo fmt --all --check`, and `cargo clippy --workspace
--all-targets -- -D warnings` pass.
- Ran `lifecycle-timing` against v1 run 38046386392's
`lifecycle-linux_amd64-*` artifacts: 121 tests, 249.5 s wall (partitions
249.5 s and 240.0 s), 1657.5 s summed.
- CI on 55ccf01 passed, including all four `Lifecycle timing` jobs
(about 11 s each on Linux). The linux_amd64 report shows 121 tests and
244.4 s wall. The live-docker artifacts now hold all 10 tests.
- CI on ff88cbf, after merging v1, passed. The windows_amd64 report
covers its three partitions: 112 tests, 198.8 s wall. The live jobs
report "Within budget": live-docker 10 tests in 208.9 s on both Linux
platforms, and live-kind 175.2 s on linux_amd64 and 158.0 s on
linux_arm64. Those jobs use `continue-on-error`, so I checked the
reports in their logs, not just the green checks.
@wscurran wscurran added the chore Build, CI, dependency, or tooling maintenance label Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants