Skip to content

ci: stop a test near its time limit - #12993

Merged
cv merged 2 commits into
v1from
ci/stop-tests-at-their-limit
Oct 11, 2026
Merged

cv merged 2 commits into
v1from
ci/stop-tests-at-their-limit

Conversation

@cv

@cv cv commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #12979

Failure

.config/test-budgets.yaml limits each test to 8 s in the test step, 90 s in each lifecycle partition, and 180 s and 120 s in the live suites, but cargo ci checks the limit only after the step finishes. Nextest stopped a test only after 300 s in the ci and lifecycle profiles, 600 s in live-docker, and 1200 s in live-kind, so a hung test held a runner for minutes before CI reported it.

Decision

Each profile in .config/nextest.toml uses its step's per-test limit as the slow-timeout period, so nextest reports a test as slow at the limit, and stops it at a multiple of the limit. The multiple is the margin for macOS, Windows, and local runs, which only report budgets:

Step Per-test limit Stopped after Slowest test seen on a report-only platform
test 8 s 24 s 14.9 s on darwin_arm64
lifecycle 90 s 180 s 104.6 s on windows_amd64 since #12965 split the slow remote-service scenarios (205.6 s before it)
live-docker 180 s 360 s Linux only; 139.2 s on linux_amd64
live-kind 120 s 240 s Linux only; 79.1 s on linux_amd64

The times come from the JUnit artifacts of the last 37 Rust runs. The test step needs three times its limit: its slowest macOS test, journey_tree_preview::minimum_inline_fixture_prints_the_questions_it_can_materialize, takes nearly twice the limit, so twice would leave about 7% headroom.

each_nextest_profile_stops_a_test_near_its_per_test_limit fails when a profile's period differs from its step's test_seconds, or when a profile stops a test later than three times the limit. It resolves inherits and adds toml as a dev-dependency of nemoclaw-build, the version and features nemoclaw-sdk already uses. The testing guide and the budget file's header explain how the two limits relate.

The per-binary limits for provider contract tests from #12990 are out of scope. Those tests still stop at the lifecycle profile's 180 s, not near their 10 to 22 s limits.

Validation

  • The new drift test failed before the profile change (the ci nextest profile reports a test as slow after 30 s, but the test step allows 8 s per test) and passes after it.
  • With the repository's ci profile, the pinned nextest 0.9.144 reported a 60 s sleeping test as SLOW at 8 s and 16 s, then TIMEOUT [ 24.005s]. It wrote <failure type="test timeout"/> and time="24.005" to the JUnit report.
  • a_test_nextest_stops_is_named_with_its_time_and_limit parses that JUnit shape and checks that the budget check names the test as took 24.0 s; the limit is 8 s. This is the line cargo ci prints and adds to the job summary, enforced on Linux and reported on other platforms. Nextest also fails the step on every platform.
  • cargo nextest list accepts all four profiles. cargo fmt --all and cargo clippy --locked --workspace --all-targets -- -D warnings pass.

Each nextest profile now reports a test as slow at its step's per-test
limit in .config/test-budgets.yaml and stops it at twice the limit, or
three times in the test step, instead of after up to five minutes.
A nemoclaw-build test fails when a profile's slow-timeout period and
its budget drift apart.

Closes #12979
@cv cv added area: ci CI workflows, checks, release automation, or GitHub Actions v1 NemoClaw v1 branch labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

…limit

# Conflicts:
#	.config/test-budgets.yaml
#	docs/contributing/testing.md
@cv
cv enabled auto-merge (squash) October 11, 2026 11:34
@cv
cv merged commit 67ac1c6 into v1 Oct 11, 2026
@cv
cv deleted the ci/stop-tests-at-their-limit branch October 11, 2026 11:39
cv added a commit that referenced this pull request Oct 11, 2026
Part of #12876. Follow-up to #12993, which closed #12979 before it
covered the contract budgets from #12990.

## Failure

#12990 gave each provider's contract tests a per-test limit in
`.config/test-budgets.yaml`: 22 s for `fabric-provider::contract`, 10 s
for `nemoclaw-provider::contract`, and 12 s for
`openshell-provider::contract`. Nextest still stopped those tests at the
`lifecycle` profile's 180 s, and the drift test from #12993 checked only
the step budgets.

## Decision

An override in the `lifecycle` profile for each budgeted binary,
filtered by `binary_id(=NAME)` so the filter repeats the budget's key,
reports its tests as slow at the binary's limit and stops them at twice
that limit. That is the same margin the profile's other tests get:

| Binary | Per-test limit | Stopped after | Slowest test seen, any
platform |
|---|---|---|---|
| `fabric-provider::contract` | 22 s | 44 s | 15.0 s on linux_amd64 |
| `nemoclaw-provider::contract` | 10 s | 20 s | 9.8 s on windows_amd64 |
| `openshell-provider::contract` | 12 s | 24 s | 7.1 s on windows_amd64
|

The times come from the lifecycle JUnit reports of the last 37 Rust
runs.

`each_nextest_profile_stops_a_test_near_its_per_test_limit` now also
fails in three cases:
- a budgeted binary has no override;
- an override's period differs from its binary's limit, or it stops a
test later than three times that limit;
- an override has no binary budget.

`Budgets::binaries` lists the binary budgets for that check. The testing
guide and the budget file's header describe the overrides.

## Validation

- The extended drift test failed before the overrides (`the lifecycle
nextest profile has no slow-timeout override with filter
"binary_id(=fabric-provider::contract)"`) and passes with them.
- In a scratch crate, the pinned nextest 0.9.144 applied a
`binary_id(=hang::contract)` override: the test was flagged as slow at 2
s and stopped as `TIMEOUT [4.004s]`.
- `cargo nextest list --profile lifecycle` lists
`fabric-provider::contract` under that binary ID, and all four profiles
parse.
- The `nemoclaw-build` `ci::`, archive, and timing tests pass, along
with `cargo fmt --all --check` and `cargo clippy --locked --workspace
--all-targets -- -D warnings`.
@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