Skip to content

ci(e2e): split recovery validation from soak - #7933

Closed
apurvvkumaria wants to merge 4 commits into
mainfrom
codex/7919-split-recovery-soak
Closed

ci(e2e): split recovery validation from soak#7933
apurvvkumaria wants to merge 4 commits into
mainfrom
codex/7919-split-recovery-soak

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Separate the issue #2478 recovery coverage into a short functional profile and the retained full soak. Monday-through-Saturday scheduled runs use one crash cycle and a short stability sample, while Sunday and release evidence retain all five cycles and the five-minute soak.

Related Issue

Fixes #7919

Changes

  • Parameterize the live recovery test with validated functional and soak profiles.
  • Route the functional profile Monday through Saturday and the full soak on Sunday or by explicit selection.
  • Keep the soak out of ordinary change-focused dispatch while adding it to pre-release evidence.
  • Add behavioral tests for profile validation, scheduling drift, selector behavior, and release inclusion.

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: This changes internal live-E2E scheduling and release evidence only; the documentation writer confirmed existing contributor documentation remains accurate.
  • 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: Pending normal review; both profiles preserve the same production recovery commands, cleanup, artifact, and secret boundaries.
  • 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: Internal .github/workflows/e2e.yaml, live-test profile, workflow-boundary, and release-evidence changes only.
  • 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 — E2E-support profile and workflow tests (6 passed), current-head invalid-override profile tests (7 passed), plus test/release-e2e-evidence.test.ts (11 passed)
  • 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; repository hooks and focused E2E/release suites cover the changed contracts.
  • 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

Summary by CodeRabbit

  • Tests

    • Added configurable crash-loop recovery settings to cover functional and extended soak scenarios.
    • Added stricter validation for recovery profile and malformed override values.
    • Expanded workflow boundary coverage to enforce new scheduling, job routing rules, and explicit-only soak behavior.
    • Updated release E2E evidence expectations to include the recovery soak selector.
  • Chores

    • Updated automated E2E scheduling to run functional checks Monday–Saturday and soak testing on Sunday.
    • Adjusted test reporting and scorecard dependencies to include the soak run.

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

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The E2E recovery workflow separates functional and soak profiles, resolves test parameters from environment variables, validates variant-specific workflow contracts, schedules weekday and Sunday runs separately, and includes the soak variant in reporting and release evidence.

Changes

Recovery validation and soak scheduling

Layer / File(s) Summary
Recovery profile configuration
test/e2e/live/issue-2478-recovery-profile.ts, test/e2e/live/issue-2478-crash-loop-recovery.test.ts, test/e2e/support/issue-2478-recovery-profile.test.ts
Adds functional and soak settings with profile defaults, environment overrides, strict profile validation, and parameterized crash-recovery execution.
Workflow boundary validation
tools/e2e/workflow-boundary.mts, test/e2e/support/issue-2478-recovery-workflow-boundary.test.ts
Validates separate weekday and Sunday schedules, special recovery selectors, change-focused jobs, and functional/soak-specific job contracts.
Scheduled workflow integration and reporting
.github/workflows/e2e.yaml, test/release-e2e-evidence.test.ts
Splits scheduled triggers, configures recovery job parameters and gating, includes the soak job in reporting dependencies, and updates release evidence expectations.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested labels: area: ci, area: e2e, feature

Suggested reviewers: cjagwani, cv

Sequence Diagram(s)

sequenceDiagram
  participant Scheduler
  participant E2EWorkflow
  participant RecoveryJob
  participant SettingsResolver
  participant RecoveryTest
  participant ReportJob
  Scheduler->>E2EWorkflow: trigger weekday or Sunday cron
  E2EWorkflow->>RecoveryJob: dispatch recovery variant with environment
  RecoveryJob->>SettingsResolver: resolve profile settings
  SettingsResolver->>RecoveryTest: provide crash cycles and soak duration
  RecoveryTest-->>ReportJob: publish test result and evidence
  ReportJob->>ReportJob: include soak result in scorecard
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR separates functional and soak recovery paths, updates scheduling/selectors, and adds validation/tests aligned with #7919.
Out of Scope Changes check ✅ Passed The changes stay focused on recovery scheduling, parameterization, and validation with no obvious unrelated additions.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: separating recovery validation from soak runs.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/7919-split-recovery-soak

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

@github-code-quality

github-code-quality Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 267ddec in the codex/7919-split-rec... branch remains at 96%, unchanged from commit 1ce71fa in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 267ddec in the codex/7919-split-rec... branch remains at 81%, unchanged from commit 1ce71fa in the main branch.

Show a code coverage summary of the most impacted files.
File main 1ce71fa codex/7919-split-rec... 267ddec +/-
src/lib/onboard...flight-ports.ts 67% 33% -34%
src/lib/onboard...box-prebuild.ts 92% 74% -18%
src/lib/actions...ocker-health.ts 82% 65% -17%
src/lib/actions...confirmation.ts 79% 69% -10%
src/lib/onboard...box-gpu-mode.ts 97% 92% -5%
src/lib/actions...orchestrator.ts 87% 83% -4%
src/lib/onboard/preflight.ts 80% 80% 0%
src/lib/onboard...host-anchors.ts 90% 94% +4%
src/lib/policy/...ne-exclusion.ts 91% 97% +6%
src/lib/onboard/docker-cdi.ts 70% 80% +10%

Updated July 30, 2026 19:21 UTC

@github-actions

github-actions Bot commented Jul 30, 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 E2E selections match; severity counts match.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-inference, cloud-onboard, security-posture, issue-2478-crash-loop-recovery

Workflow run details

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

@cv cv added the v0.0.99 label Jul 30, 2026

@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.

🧹 Nitpick comments (3)
tools/e2e/workflow-boundary.mts (1)

450-456: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a short comment on the presence-based opt-out semantics.

E2E_CHANGE_FOCUSED only ever legally holds "0", so its presence — not its value — is what removes the job from liveTestToJobs and therefore from focusedE2eJobsForChangedFiles. That inversion is easy to misread next to the adjacent E2E_DEFAULT_ENABLED block, which reads as a value check.

🤖 Prompt for 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.

In `@tools/e2e/workflow-boundary.mts` around lines 450 - 456, In the
FREE_STANDING_CHANGE_FOCUSED_MARKER handling, add a concise comment documenting
that the marker’s presence opts the job out of live-test mapping, while its only
valid value is "0"; keep the existing validation and mapping behavior unchanged.
test/e2e/live/issue-2478-recovery-profile.ts (1)

26-29: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider failing loudly on malformed numeric env, matching the profile check.

NEMOCLAW_E2E_CRASH_CYCLES=0 or =abc silently falls back to the profile default, while an invalid NEMOCLAW_E2E_RECOVERY_PROFILE throws. Since these are operator-supplied diagnostic overrides, a silent revert can mask a mis-typed dispatch input (e.g. a soak run that the operator thought was shortened).

♻️ Optional: throw on invalid override
-function positiveInteger(raw: string | undefined, fallback: number): number {
-  const parsed = raw ? Number(raw) : fallback;
-  return Number.isInteger(parsed) && parsed > 0 ? parsed : fallback;
-}
+function positiveInteger(name: string, raw: string | undefined, fallback: number): number {
+  if (!raw) return fallback;
+  const parsed = Number(raw);
+  if (!Number.isInteger(parsed) || parsed <= 0) {
+    throw new Error(`${name} must be a positive integer, got '${raw}'`);
+  }
+  return parsed;
+}
🤖 Prompt for 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.

In `@test/e2e/live/issue-2478-recovery-profile.ts` around lines 26 - 29, Update
positiveInteger to throw an error when raw is provided but is not a positive
integer, instead of silently returning fallback; retain fallback behavior only
when raw is undefined, matching the validation behavior of
NEMOCLAW_E2E_RECOVERY_PROFILE.
.github/workflows/e2e.yaml (1)

5597-5661: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Env values line up with the validator and resolver; consider anchoring the duplicated step block.

Profile/cycle/soak values match PROFILE_DEFAULTS in test/e2e/live/issue-2478-recovery-profile.ts and the variants list in tools/e2e/workflow-boundary.mts, and the distinct NEMOCLAW_SANDBOX_NAME keeps a dispatched functional run from colliding with the Sunday soak.

The soak job's ~60 lines of steps are a verbatim copy of the functional job's. This file already uses YAML anchors (*dockerhub-auth), so the OpenShell-resolution run: block and the upload/cleanup steps could be anchored once and aliased, which also keeps the validator's shared step assertions honest as the two jobs evolve.

🤖 Prompt for 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.

In @.github/workflows/e2e.yaml around lines 5597 - 5661, Deduplicate the
identical E2E step sequence shared by the functional and soak jobs by defining
YAML anchors for the OpenShell-resolution run step, artifact upload step, and
Docker-auth cleanup step, then reference those anchors in both jobs. Preserve
each job’s existing environment, test invocation, and always-run conditions
while keeping the shared-step structure aligned with the workflow validator.
🤖 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.

Nitpick comments:
In @.github/workflows/e2e.yaml:
- Around line 5597-5661: Deduplicate the identical E2E step sequence shared by
the functional and soak jobs by defining YAML anchors for the
OpenShell-resolution run step, artifact upload step, and Docker-auth cleanup
step, then reference those anchors in both jobs. Preserve each job’s existing
environment, test invocation, and always-run conditions while keeping the
shared-step structure aligned with the workflow validator.

In `@test/e2e/live/issue-2478-recovery-profile.ts`:
- Around line 26-29: Update positiveInteger to throw an error when raw is
provided but is not a positive integer, instead of silently returning fallback;
retain fallback behavior only when raw is undefined, matching the validation
behavior of NEMOCLAW_E2E_RECOVERY_PROFILE.

In `@tools/e2e/workflow-boundary.mts`:
- Around line 450-456: In the FREE_STANDING_CHANGE_FOCUSED_MARKER handling, add
a concise comment documenting that the marker’s presence opts the job out of
live-test mapping, while its only valid value is "0"; keep the existing
validation and mapping behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: faa230b6-04b4-4fa2-96c5-4ff90394ef5b

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce71fa and fd87ec7.

📒 Files selected for processing (7)
  • .github/workflows/e2e.yaml
  • test/e2e/live/issue-2478-crash-loop-recovery.test.ts
  • test/e2e/live/issue-2478-recovery-profile.ts
  • test/e2e/support/issue-2478-recovery-profile.test.ts
  • test/e2e/support/issue-2478-recovery-workflow-boundary.test.ts
  • test/release-e2e-evidence.test.ts
  • tools/e2e/workflow-boundary.mts

@apurvvkumaria
apurvvkumaria requested a review from cjagwani July 30, 2026 19:04
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@prekshivyas prekshivyas self-assigned this Jul 30, 2026
@cjagwani cjagwani self-assigned this Jul 30, 2026

@cjagwani cjagwani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes for one focused-E2E coverage gap. The functional/soak split, release inclusion, secret boundaries, cleanup, and targeted tests otherwise look sound.

errors.push(`${jobId} job ${FREE_STANDING_CHANGE_FOCUSED_MARKER} must be "0" when set`);
}
} else {
for (const file of collectLiveTestFiles(rawJob)) addMapValue(liveTestToJobs, file, jobId);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Map the new recovery-profile helper to the functional E2E job

collectLiveTestFiles() only discovers the .test.ts path embedded in the workflow job. As a result, focusedE2eJobsForChangedFiles(["test/e2e/live/issue-2478-recovery-profile.ts"]) returns [], while changing issue-2478-crash-loop-recovery.test.ts selects issue-2478-crash-loop-recovery. The new helper owns the functional/soak defaults and validation, so a future helper-only change will skip the functional recovery job, contrary to #7919’s requirement to run it when owning files change. Please add an explicit dependency mapping (or equivalent import-aware mapping) and a regression assertion for the helper path while continuing to exclude the soak job from change-focused dispatch.

@coderabbitai coderabbitai Bot mentioned this pull request Jul 30, 2026
23 tasks
@cv

cv commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

I don't think moving the full recovery signal to a weekly lane is the right tradeoff. If this test is too slow or expensive to run with the changes it protects, that is a problem with the test boundary—not a reason to create another execution profile, schedule, selector, reporting path, and release-evidence contract that runs even less frequently.

A weekly failure arrives late, is harder to attribute to the change that caused it, and can leave this behavior broken for days before we learn about it. The additional lane also becomes permanent CI surface that we have to maintain.

We should instead make the test fast enough for the existing change-focused lane. Move the repeated recovery/state assertions into deterministic unit or integration tests that cover the functionality directly, and retain at most one small live E2E to prove the wiring that cannot be exercised below that boundary. If the live test still needs five crash cycles and a five-minute soak, we should first establish what unique defect each repetition catches and whether that evidence belongs in a benchmark or diagnostic—not solve the cost by running the same test weekly.

My preference is to avoid adding the weekly soak lane and use this work to reduce or eliminate the expensive live coverage.

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.

perf(e2e): move recovery repetition into deterministic tests

4 participants