Repository navigation
test: replace the managed bearer cleanup lifecycle scenario with SDK and contract tests - #13874
Merged
Merged
Conversation
…un in parallel The scenario spent about 40 s locally on 14 nemoclaw commands, each paying the Docker provider's 2 s network refresh; CI runs of it took 54-92 s against a 90 s budget. Cleanup recovery with damaged storage and the failure, key, and teardown checks now run in scenarios of their own, each with one runtime, so the lifecycle profile runs them side by side.
…K test Both lifecycle scenarios are deleted. Replacement cleanup, the export refusal while it is pending, and teardown with a deposed container now run through Deployment over scripted OpenTofu, with plans in the shapes OpenTofu 1.12.9 and the Docker provider 4.6.0 reported for them. Their other checks already fail in unit and contract tests when the behavior they guard is removed.
Contributor
kaofelix
marked this pull request as draft
October 27, 2026 22:42
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…key export check The SDK test reads canned plans; a provider contract test now checks that pinned OpenTofu and the Docker provider produce them. The bearer scenario again shows that export succeeds while the generated key is insecure and apply refuses it.
…he cleanup contract test The bearer scenario's export now runs while the generated key is readable by others, which adds no command. The contract test checks only the plans and state the SDK reads, including that drift reports nothing for the old container; deleting the old container is OpenTofu's job.
Collaborator
Author
Authoring session — opening
|
kaofelix
marked this pull request as ready for review
October 29, 2026 11:29
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.
Failure
managed_bearer_cleanup_recovers_damage_keeps_bindings_and_teardown_accepts_both_identitiestook 40-43 s locally and 54-92 s onlinux_amd64CI. The lifecycle limit is 90 s per test. The scenario runs 14nemoclawcommands of about 3 s each. About 2 s of each command is the pinnedkreuzwerker/dockerprovider waiting before everydocker_networkread (#12982).Decision
Replace the scenario with faster tests. Every NemoClaw behavior it checked still has a test that fails when the behavior breaks, and the affected lifecycle tests drop from about 74 s to about 37 s summed in local runs.
Each check that only this scenario made moves to the fastest test that can still make it.
Most of these checks concern replacement cleanup. When OpenTofu replaces a container but fails to delete the old one, it keeps the old container in state as a deposed object, and the next apply deletes it.
replacement_cleanup. It runsDeploymentover the scripted OpenTofu.nemoclaw-providercontract testreplacement_cleanup. It runs OpenTofu and the provider against the SSH simulator, with no CLI and no network.The remaining checks already had faster tests; see Validation.
How the two cleanup tests fit together
The contract test pins what OpenTofu reports. The SDK test feeds the SDK copies of those reports. Each test's comment points to the other.
"deposed":"deadbeef",["delete"],before.id= old ID"deposed":"deadbeef",["no-op"],beforeandafternullOpenTofu reports no
resource_driftentry for the old container in any of these plans, and the contract test asserts that too. So the copies match the real output on every field the SDK reads.The contract test checks plans and state only. Deleting the old container is OpenTofu's and the provider's job (
docs/provider.md, scope), so the test never runstofu applyon the deposed container.Why the key check stays in a lifecycle scenario
docs/inference.mdpromises that export does not need the inference key. Two things keep that true: readiness reads the key only during apply, and no provider reads it during refresh. A unit test could cover only one provider's refresh. The lifecycle scenario covers every provider and the SDK at once, and reusing its export costs no extra time.Validation
Coverage
I removed each production behavior the deleted scenario guarded, one at a time. For each removal I rebuilt the bundle from the changed code and ran the unit, integration and lifecycle tests. An unchanged control run passed everything.
replacement_cleanup(SDK)replacement_cleanup(SDK)replacement_cleanup(SDK)replacement_cleanup(SDK)nemoclaw-providerunit test for vLLM readiness; proxy readiness contract testnemoclaw-providerunit testnemoclaw-dockerstorage unit testnemoclaw-tofurefuses any change of bound ID, and theservice_storagecontract test asserts that through OpenTofuThe scenario's other checks repeated other scenarios. A failed plan or apply leaves state and the engine unchanged in the vLLM and Ollama
remote_servicescenarios. Teardown with an incompatible image runs in the same two scenarios.A second change showed where the export guarantee comes from. Making export plan the whole graph, readiness included, still passed the key check, because readiness defers its key read to apply. So the guarantee rests on readiness and refresh, not on how export builds its configuration.
Runtime
Local runs on macOS, two runs each, with the same bundle:
origin/v1CI times, from the two latest
v1runs and this PR's run:v1linux_amd64linux_arm64darwin_arm64windows_amd64The bearer scenario's CI times on this PR stay within its range on
v1.The
nemoclaw-providercontract tests stay within their 82 s budget.Checks run
cargo cipassed locally. I did not runlive-dockerorlive-kindlocally, because nothing that runs in images or on Kubernetes changed; CI ran both and they passed. CI's lifecycle tests passed on all four platforms.Limits
create_before_destroy, which NemoClaw's graphs never set. The deleted scenario wrote this state by hand as well. Inference: the SDK handles a state that NemoClaw does not produce today.cleanup_failurecontrol no longer has a caller. Removing it changes code that every simulator request goes through, so it is left for a separate change.