Skip to content

test: split the slow remote-service lifecycle scenarios - #12965

Merged
cv merged 2 commits into
v1from
test/split-bearer-lifecycle
Oct 10, 2026
Merged

cv merged 2 commits into
v1from
test/split-bearer-lifecycle

Conversation

@cv

@cv cv commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12876; addresses the slowest-scenario part of #12882.

Failure

remote_service::managed_bearer_credentials_survive_export_reapply_and_destroy took 129–153 s on linux_amd64 across the last eight v1 and PR runs, and remote_model_lifecycle_* and remote_ollama_lifecycle_* took 101–123.6 s. No other lifecycle test exceeded 70 s. These tests blocked lowering lifecycle.test_seconds in .config/test-budgets.yaml from 180 s to 120 s.

A timed local run showed that the bearer test spent almost all its time in 37 sequential CLI commands: about 6.7 s per successful apply, 3.5 s per failed apply, and 8 s for destroy. Setup took under a second. The bearer path also repeated image-compatibility, readiness, and transport checks that the unauthenticated scenarios already run against the same runtime.

Decision

Replace the lifecycle() helper with a Scenario setup and one function per behavior, then compose each test from the functions it needs. Assertions move unchanged.

Before After
managed_bearer_credentials_survive_export_reapply_and_destroy managed_bearer_credentials_survive_recovery_reapply_and_replacement_outside_state: registration, failed-creation and process/cache recovery, export without the key, reapply, compute replacement, destroy
managed_bearer_storage_or_key_damage_stops_plan_and_apply_without_changing_bindings: credential-daemon retargeting, missing/foreign/substituted credential volume, insecure key mode
managed_bearer_replacement_cleanup_recovers_and_teardown_accepts_both_identities: interrupted replacement cleanup, then teardown with an incompatible image
remote_{model,ollama}_lifecycle_preserves_data_and_stops_on_observation_failure remote_{model,ollama}_apply_recovers_failed_creation_and_lost_process_or_cache_keeping_data
remote_{model,ollama}_reapply_and_drift_keep_bindings_and_stop_on_observation_failure

The Pi, partial-destroy, and pulled-image tests keep their names and steps.

The bearer tests no longer run these checks, which do not depend on authentication:

  • present-image compatibility: still runs in the vLLM, Ollama, and Pi apply tests
  • the readiness gate: still runs in the vLLM and Ollama reapply tests; authenticated_vllm_readiness_rechecks_key_permissions in nemoclaw-provider covers key checks during readiness
  • transport failure: still runs in the vLLM and Ollama reapply tests

The storage-damage test applies twice before it records its baseline. The first apply leaves attributes that the next refresh normalizes, and the insecure-key apply refreshes state before it fails.

This also sets lifecycle.test_seconds to 120 and fixes the stale remote_service::managed_hermes filter in docs/contributing/integration-tests.md. That filter matched no test.

Validation

  • All 12 remote_service:: tests passed locally on linux_arm64 under nextest with 4 threads and a freshly built bundle. The slowest took 62 s, and the run took 117 s.

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, and budgets_name_each_step_over_its_wall_time_and_each_test_over_its_limit passed.

  • CI run 38049406349 on 6db1e7b passed every Linux lifecycle partition with the 120 s limit enforced:

    Partition Wall Slowest test
    linux_amd64 1/2 229 s (was 250 s) 68 s, managed_pi_applies_…
    linux_amd64 2/2 209 s (was 240 s) 74 s, remote_model_reapply_and_drift_…
    linux_arm64 1/2 207 s (was 232 s) 57 s, managed_pi_applies_…
    linux_arm64 2/2 185 s (was 219 s) 64 s, remote_model_reapply_and_drift_…

    The bearer tests took 65 s, 61 s, and 46 s on linux_amd64. The budget comment records 229 s and 74 s. lifecycle.wall_seconds stays at 360 s.

  • CI run 38049973413 on the head commit passed every lifecycle partition. The slowest test took 74 s on linux_amd64 (partitions 204 s and 206 s), 63 s on linux_arm64, 83 s on windows_amd64, and 66 s on darwin_arm64.

The bearer scenario took about 150 s on linux_amd64 CI, and the remote vLLM
and Ollama scenarios reached 120-123 s, which blocked a 120 s per-test
lifecycle limit. Each ran about 25-38 CLI commands in one helper.

Split them into tests that each own one behavior and share one Scenario
setup. Bearer scenarios no longer repeat the image-compatibility, readiness,
and transport checks that the unauthenticated scenarios own. Lower the
lifecycle per-test limit to 120 s.

Refs #12882
@cv cv added area: e2e End-to-end tests, nightly failures, or validation infrastructure v1 NemoClaw v1 branch labels Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 6a95532 into v1 Oct 10, 2026
@cv
cv deleted the test/split-bearer-lifecycle branch October 10, 2026 12:10
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.
cv added a commit that referenced this pull request Oct 10, 2026
Closes #12877. Part of #12876.

## Failure

After #12965, each lifecycle partition takes at most 207 s on the Linux
runners, and the slowest test takes 67 s. The current budgets of 360 s
per partition and 120 s per test would only catch a regression once it
nearly doubled a partition.

## Decision

- **Lifecycle budget:** `lifecycle` now allows 300 s per partition and
90 s per test. That keeps about 45% headroom over the [latest `v1`
run](https://github.com/NVIDIA/NemoClaw/actions/runs/38070042632).
- **Docs:** the budget table in `docs/contributing/testing.md` shows the
new limits.

## Validation

Latest `v1` run:

| Platform | Partition 1 | Partition 2 |
|---|---|---|
| linux_amd64 | 202 s, slowest test 55.6 s | 190 s, slowest test 67.3 s
|
| linux_arm64 | 207 s, slowest test 57.7 s | 185 s, slowest test 63.5 s
|

The budget-parsing test passes. This PR's CI enforces the new budget.
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.
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance labels 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 area: e2e End-to-end tests, nightly failures, or validation infrastructure 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