Skip to content

test(sandbox): exercise active create handoff - #8730

Merged
apurvvkumaria merged 2 commits into
mainfrom
codex/8729-create-handoff-tests
Aug 10, 2026
Merged

test(sandbox): exercise active create handoff#8730
apurvvkumaria merged 2 commits into
mainfrom
codex/8729-create-handoff-tests

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Tests now exercise the serialized create handoff added by #8729 at the actual lifecycle boundary. This also fixes the late shard-12 failure where the integration fixture never reported that its fake create process exited after SIGTERM.

Related Issue

Follow-up to #8729 and its CodeRabbit ordering finding.

Changes

  • Invoke the captured create poll before the mocked stream resolves and assert the poll, stream completion, and deferred ensureApplied() order.
  • Make the existing process-group fixture emit the fake create child's close event after SIGTERM, matching the ownership-release contract.
  • Assert that the waited-for stream is not detached, with no production-code changes or new test files.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: Test fixtures now match the already-merged ownership contract; no production behavior or user-facing surface changes.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Test-only changes preserve the fail-closed create timeout, simulate only the expected process exit, and do not alter production lifecycle, rollback, readiness, or compatibility behavior.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: No documentation paths changed. Existing docs/get-started/quickstart.mdx and docs/reference/commands.mdx already describe the unchanged ready and recreation contract.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run --project cli src/lib/onboard/sandbox-gpu-create-flow.test.ts src/lib/sandbox/create-stream.test.ts (56 passed); npx vitest run --project integration test/onboard-sandbox-recreation.test.ts -t "waits for the create stream to close" (1 passed); the refined deferred-boundary test passed again after review feedback.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: Not applicable; this is a two-test fixture correction protected by targeted tests and normal hooks.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria self-assigned this Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The tests verify that patch application waits for create completion and that sandbox recreation waits for the create stream to close. They also update child-process termination and cleanup expectations.

Changes

Sandbox creation handoff

Layer / File(s) Summary
Deferred patch application
src/lib/onboard/sandbox-gpu-create-flow.test.ts
The no-GPU recreation test records polling, create completion, and patch application order.
Create stream lifecycle
test/onboard-sandbox-recreation.test.ts
The recreation tests require stream closure after readiness and verify child termination and cleanup behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: area: sandbox

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the test changes for the active sandbox create handoff lifecycle.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/8729-create-handoff-tests

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit b16e532 in the codex/8729-create-ha... branch remains at 96%, unchanged from commit 273e521 in the main branch.


Updated August 10, 2026 11:31 UTC

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
1 additional E2E selection from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • gpu-e2e: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — create stream at test/onboard-sandbox-recreation.test.ts:1205: Keep `create stream` for the stream-based sandbox-create operation.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: cloud-onboard

2 optional E2E recommendations
  • onboard-repair
  • onboard-resume

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/onboard/sandbox-gpu-create-flow.test.ts`:
- Around line 515-520: Update the streamSandboxCreate mock in the sandbox
creation flow test to return a deferred promise that remains pending after
invoking onPoll; assert patch.ensureApplied has not been called while that
promise is pending, then resolve the deferred promise and await the flow before
verifying completion.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 66226845-c7a1-4247-93d4-c4070ed647af

📥 Commits

Reviewing files that changed from the base of the PR and between 273e521 and 70160ea.

📒 Files selected for processing (2)
  • src/lib/onboard/sandbox-gpu-create-flow.test.ts
  • test/onboard-sandbox-recreation.test.ts

Comment thread src/lib/onboard/sandbox-gpu-create-flow.test.ts
@apurvvkumaria
apurvvkumaria enabled auto-merge (squash) August 10, 2026 11:28
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria
apurvvkumaria merged commit 521ea0f into main Aug 10, 2026
87 of 88 checks passed
@apurvvkumaria
apurvvkumaria deleted the codex/8729-create-handoff-tests branch August 10, 2026 11:33
@github-actions github-actions Bot added the v0.0.106 Release target label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.106 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants