Skip to content

ci: budget each provider's contract tests - #12990

Merged
cv merged 1 commit into
v1from
ci/contract-test-budgets
Oct 11, 2026
Merged

cv merged 1 commit into
v1from
ci/contract-test-budgets

Conversation

@cv

@cv cv commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #12980.

Failure

Each provider's contract binary runs inside the lifecycle partitions, so only the lifecycle budget limits it: 300 s per partition and 90 s per test. A contract binary could slow down a lot before CI noticed. Its tests are split across partitions by hash, so no partition sees a whole binary's time.

Decision

.config/test-budgets.yaml gets a binaries section, keyed by nextest binary name. Each entry has summed_seconds, the binary's test times added up across a platform's partitions, and test_seconds, the limit for any one of its tests.

Measured in 14 recent v1 runs on linux_amd64 and linux_arm64. Each budget allows about 30–50% above the highest measured time:

Binary Tests Highest summed Budget Slowest test Limit
fabric-provider::contract 3 27 s 40 s 16.4 s 22 s
nemoclaw-provider::contract 29 80 s 110 s 7.4 s 10 s
openshell-provider::contract 44 142 s 190 s 8.1 s 12 s

nemoclaw-provider had 29 tests only in the 3 latest runs (64–80 s summed). Earlier runs had 15 or 26. #12876 proposed 90 s per provider and 15 s per fixture. Those limits fail today: openshell-provider sums to 122–142 s, and the slowest test is in fabric-provider: pi_configuration_updates_without_replacing_the_sandbox, up to 16.4 s. The issue attributes the 14.9 s fixture to openshell, but in these reports the slowest openshell test is 8.1 s.

Where the budgets are checked:

  • The Lifecycle timing job already joins every partition's report, so it checks the binary budgets. It shows a table of each binary's tests, summed time, slowest test, and budgets. On Linux runners, a binary or test over its budget fails the job with the time and the budget. This PR removes the job's continue-on-error, so that failure now fails Test / PLATFORM. The job also checks out the repository, to read the budgets.
  • An unpartitioned cargo ci lifecycle run, the one plain cargo ci runs, shows the same table after its step budget. A partition holds only part of each binary, so partition reports leave binary budgets out.
  • Budgets now holds both step and binary budgets. partitioned_report takes the budgets and returns the report together with what is over budget.

Validation

  • First observed failing: the new test binary_budgets_bound_each_binary_summed_across_partitions_and_each_of_its_tests, and the repository-budget check in budgets_name_each_step_over_its_wall_time_and_each_test_over_its_limit. Both pass now, with the rest of the nemoclaw-build integration tests (85 passed).
  • I ran nemoclaw-build lifecycle-timing with GITHUB_ACTIONS=1 on the downloaded linux_amd64 reports from v1 run 38129638172. It exits 0 with the repository budgets. With nemoclaw-provider::contract lowered to 70 s, it exits 1 and prints: nemoclaw-provider::contract: 79.8 s summed exceeds the 70 s budget.
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and actionlint on native-platform.yml and rust.yml pass.
  • I did not run the full suite or cargo ci locally; this PR's CI runs them.

@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

@cv
cv merged commit 67cac31 into v1 Oct 11, 2026
@cv
cv deleted the ci/contract-test-budgets branch October 11, 2026 11:18
cv added a commit that referenced this pull request Oct 11, 2026
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.
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