Skip to content

test(conformance): migrate lifecycle main-result tests to lifecycle stories - #4628

Open
politerealism wants to merge 1 commit into
NVIDIA:codex/4119-suite-layoutfrom
politerealism:test/3954-lifecycle-main-result-stories/politerealism
Open

politerealism wants to merge 1 commit into
NVIDIA:codex/4119-suite-layoutfrom
politerealism:test/3954-lifecycle-main-result-stories/politerealism

Conversation

@politerealism

Copy link
Copy Markdown
Contributor

Summary

Move the canonical-main result tests from the legacy sandbox_lifecycle binary into the conformance lifecycle area. How a sandbox reports its main process's result isn't driver-specific, so it belongs with the other lifecycle stories and runs against any prepared gateway. Stacked on #4538, which relocates the suites.

Related Issue

Contributes to #3954. No separate issue: this migrates existing coverage.

Changes

  • Add five stories to lifecycle/, one per file, keeping the original test names:
    • canonical_main_exit_zero_completes_persistent_sandbox: a main that exits 0 leaves a retained sandbox in Completed with exit code 0, and its output reaches the create command.
    • canonical_main_nonzero_exit_preserves_status: the create command exits with the main's code, and the sandbox is Error with that code recorded.
    • detached_canonical_main_exit_zero_reaches_completed and detached_canonical_main_nonzero_exit_reaches_error: a detached main exits only after the sandbox is created (it waits for a release file), then reaches Completed or Error with its code.
    • detached_main_exit_during_provisioning_is_classified_as_workload_result: a main that exits while the sandbox is provisioning is reported as Error with its exit code and the MainProcessFailed Ready reason, not as a provisioning failure.
  • Assertions read phase, exit_code and the Ready condition from sandbox get --output json instead of matching Phase: ... text. The server can mark a sandbox Error (ContainerExited) before the supervisor reports the exit code, so the helper keeps polling until both are present and fails at once on a different code.
  • The stories run with --no-tty and the target's default image. The support runner can't allocate a pty, and the legacy exit-zero and nonzero tests ran create under one, so those two legacy tests stay in sandbox_lifecycle for now: removing them would drop interactive-create coverage of exit-code propagation. They overlap the new main_exit_* stories until the runner can allocate a pty. The TTY-specific cases (canonical_tty_main_uses_sandbox_environment and the TTY halves of other tests) stay for the same reason.
  • Delete the three detached tests from e2e/rust/tests/sandbox_lifecycle.rs; they have no pty dependence. The binary stays on the Podman archive exclusion list because it still holds the remaining tests.
  • Helpers added to the area: create_with_main, expect_terminal_result, run_gated_main, exec_succeeds and require_output_line. create_running_sandbox now reuses create_with_main.

Testing

  • mise run pre-commit passes
  • The five stories pass against a rootless Podman gateway (e2e/with-podman-gateway.sh)
  • Deliberate-failure checks on the same gateway, each failing exactly the intended story (the nonzero stories were mutated in both the create-code and terminal-state halves): the exit-zero story expecting Error, the nonzero story expecting code 8, the detached zero story expecting Error, the provisioning story expecting the wrong Ready reason, and the output line never matching (fails the two non-detached stories only)
  • tmachine guests: the full conformance archive passes in the Ubuntu rootful Docker guest (tmachine test ubuntu-docker-rootful binaries conformance) and in the Ubuntu K3s guest (tmachine test ubuntu-k3s k3s conformance); the archive built from this commit lists the five stories. The success logs don't print per-test names.
  • Not verified: that the provisioning story's exit 11 lands while the sandbox is still provisioning (it depends on timing, and the gateway log doesn't record phase changes); the story does check the result and the MainProcessFailed reason
  • Not run: macOS (tmachine guests are Linux only), Fedora Podman guests, other drivers

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

…tories

Move the canonical-main result tests from the legacy sandbox_lifecycle
binary into the conformance lifecycle area, one story per file: exit zero
completes a retained sandbox, a nonzero exit is preserved, detached mains
reach Completed or Error, and a main that exits while provisioning is
reported as a workload result.

The stories read phase and exit code from `sandbox get --output json`
instead of matching CLI text, wait for the exit code to be recorded, and
run without a TTY. The provisioning story also checks the documented
MainProcessFailed Ready reason.

Remove the three detached tests from sandbox_lifecycle. Keep the two
non-detached exit tests there, since they run create under a pty and the
support runner cannot allocate one yet.

Contributes to NVIDIA#3954

Signed-off-by: politerealism <burdcat17@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant