Repository navigation
ci: budget each provider's contract tests - #12990
Merged
Merged
Conversation
Contributor
This was referenced Oct 11, 2026
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.
This was referenced Oct 11, 2026
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`.
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.
Closes #12980.
Failure
Each provider's
contractbinary 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.yamlgets abinariessection, keyed by nextest binary name. Each entry hassummed_seconds, the binary's test times added up across a platform's partitions, andtest_seconds, the limit for any one of its tests.Measured in 14 recent
v1runs on linux_amd64 and linux_arm64. Each budget allows about 30–50% above the highest measured time:fabric-provider::contractnemoclaw-provider::contractopenshell-provider::contractnemoclaw-providerhad 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-providersums to 122–142 s, and the slowest test is infabric-provider:pi_configuration_updates_without_replacing_the_sandbox, up to 16.4 s. The issue attributes the 14.9 s fixture toopenshell, but in these reports the slowestopenshelltest is 8.1 s.Where the budgets are checked:
Lifecycle timingjob 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'scontinue-on-error, so that failure now failsTest / PLATFORM. The job also checks out the repository, to read the budgets.cargo ci lifecyclerun, the one plaincargo ciruns, shows the same table after its step budget. A partition holds only part of each binary, so partition reports leave binary budgets out.Budgetsnow holds both step and binary budgets.partitioned_reporttakes the budgets and returns the report together with what is over budget.Validation
binary_budgets_bound_each_binary_summed_across_partitions_and_each_of_its_tests, and the repository-budget check inbudgets_name_each_step_over_its_wall_time_and_each_test_over_its_limit. Both pass now, with the rest of thenemoclaw-buildintegration tests (85 passed).nemoclaw-build lifecycle-timingwithGITHUB_ACTIONS=1on the downloaded linux_amd64 reports from v1 run 38129638172. It exits 0 with the repository budgets. Withnemoclaw-provider::contractlowered 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, andactionlintonnative-platform.ymlandrust.ymlpass.cargo cilocally; this PR's CI runs them.