Skip to content

fix(e2e): replace broken fault injection in onboard-repair and onboard-resume tests - #2657

Merged
cv merged 2 commits into
mainfrom
fix/onboard-e2e-fault-injection
Apr 29, 2026
Merged

fix(e2e): replace broken fault injection in onboard-repair and onboard-resume tests#2657
cv merged 2 commits into
mainfrom
fix/onboard-e2e-fault-injection

Conversation

@jyaunches

@jyaunches jyaunches commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the persistent onboard-repair-e2e and onboard-resume-e2e nightly failures by replacing a broken fault injection mechanism. Zero product code changes — test-only fix.

Problem

Both tests create interrupted onboard state by setting NEMOCLAW_POLICY_MODE=invalid, expecting onboard to process.exit(1) at the policy step. PR #2434 (merged Apr 24) intentionally changed this behavior: invalid policy modes now console.warn() and fall back to suggested presets instead of hard-failing. Onboard completes successfully (exit 0) where the tests expect exit 1.

Both tests have failed in every nightly run since PR #2607 wired them into the pipeline on Apr 28.

Fix

Replace NEMOCLAW_POLICY_MODE=invalid with NEMOCLAW_POLICY_MODE=custom (without setting NEMOCLAW_POLICY_PRESETS). This uses a real, stable validation path in setupPoliciesWithSelection():

if (policyMode === "custom" || policyMode === "list") {
  chosen = parsePolicyPresetEnv(process.env.NEMOCLAW_POLICY_PRESETS || "");
  if (chosen.length === 0) {
    console.error("  NEMOCLAW_POLICY_PRESETS is required when NEMOCLAW_POLICY_MODE=custom.");
    process.exit(1);  // ← still a hard exit, as it should be
  }
}

This is correct product behavior (custom mode requires presets), and it triggers the same process.exit(1) → session markStepFailed() flow the tests need.

Changes

  • test/e2e/test-onboard-repair.sh: Replace NEMOCLAW_POLICY_MODE=invalidNEMOCLAW_POLICY_MODE=custom + NEMOCLAW_POLICY_PRESETS="", update assertion
  • test/e2e/test-onboard-resume.sh: Same change

Testing

These tests run as onboard-repair-e2e and onboard-resume-e2e in the nightly pipeline. Requesting a nightly dispatch to validate.

Related

Summary by CodeRabbit

  • Tests
    • Updated end-to-end flows to induce policy-step validation via a custom mode with empty presets and expect the corresponding validation message.
    • Broadened resume verification to accept either re-running or explicitly skipping inference.
    • Made sandbox-creation checks more generic.
    • Added an extra interrupted re-creation run to exercise conflict-detection on resume.

…d-resume tests

PR #2434 changed invalid NEMOCLAW_POLICY_MODE values from process.exit(1)
to a graceful console.warn() fallback. This broke the fault injection
mechanism in test-onboard-repair.sh and test-onboard-resume.sh, which
relied on NEMOCLAW_POLICY_MODE=invalid to force a policy-step failure
and create interrupted session state for resume/repair testing.

Replace with NEMOCLAW_POLICY_MODE=custom (without NEMOCLAW_POLICY_PRESETS),
which is a real validation path that still exits 1 at the policy step.

Fixes #2573
@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5bcee540-1ba0-4d98-ae4d-66f33e5dc6f3

📥 Commits

Reviewing files that changed from the base of the PR and between d3fd8d1 and fd6e6f8.

📒 Files selected for processing (2)
  • test/e2e/test-onboard-repair.sh
  • test/e2e/test-onboard-resume.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/e2e/test-onboard-resume.sh
  • test/e2e/test-onboard-repair.sh

📝 Walkthrough

Walkthrough

The PR updates two e2e test scripts to change how Phase 2 policy-step failures are induced (use NEMOCLAW_POLICY_MODE=custom with NEMOCLAW_POLICY_PRESETS="" instead of NEMOCLAW_POLICY_MODE=invalid), adjusts assertions to match the new validation message, relaxes/sanitizes Phase 3 sandbox/inference checks, and adds an extra interrupted re-creation run in the repair test to exercise name-conflict behavior.

Changes

Cohort / File(s) Summary
Onboard repair test
test/e2e/test-onboard-repair.sh
Replace NEMOCLAW_POLICY_MODE=invalid with NEMOCLAW_POLICY_MODE=custom + NEMOCLAW_POLICY_PRESETS="" to force policy validation failure; update assertion to match "POLICY_PRESETS is required when POLICY_MODE=custom"; relax sandbox-creation check to not depend on a specific step index; add an extra interrupted re-creation run before resume to trigger sandbox-name conflict path.
Onboard resume test
test/e2e/test-onboard-resume.sh
Same policy-failure change (custom + empty presets) and updated assertion text; broaden Phase 3 resume verification so inference setup may either re-run or be explicitly skipped (accept [resume] Skipping inference / [reuse] Skipping inference).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibbled logs and hopped through tests,

custom modes and empty vests,
a skipped step here, a conflict there,
I patched the flow with whiskered care. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: replacing broken fault injection mechanisms in two e2e test files to fix nightly failures.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/onboard-e2e-fault-injection

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 25088948895
Branch: fix/onboard-e2e-fault-injection
Requested jobs: onboard-repair-e2e,onboard-resume-e2e
Summary: 0 passed, 0 failed, 22 skipped

Job Result
cloud-e2e ⏭️ skipped
cloud-inference-e2e ⏭️ skipped
cloud-onboard-e2e ⏭️ skipped
deployment-services-e2e ⏭️ skipped
diagnostics-e2e ⏭️ skipped
docs-validation-e2e ⏭️ skipped
gpu-e2e ⏭️ skipped
hermes-e2e ⏭️ skipped
inference-routing-e2e ⏭️ skipped
messaging-providers-e2e ⏭️ skipped
network-policy-e2e ⏭️ skipped
overlayfs-autofix-e2e ⏭️ skipped
rebuild-hermes-e2e ⏭️ skipped
rebuild-openclaw-e2e ⏭️ skipped
sandbox-operations-e2e ⏭️ skipped
sandbox-survival-e2e ⏭️ skipped
shields-config-e2e ⏭️ skipped
skill-agent-e2e ⏭️ skipped
skip-permissions-e2e ⏭️ skipped
snapshot-commands-e2e ⏭️ skipped
token-rotation-e2e ⏭️ skipped
upgrade-stale-sandbox-e2e ⏭️ skipped

@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 (1)
test/e2e/test-onboard-repair.sh (1)

137-143: Consider extracting shared Phase-2 fault-injection setup into a helper.

test-onboard-repair.sh and test-onboard-resume.sh now duplicate the same interruption setup/comments; centralizing this would reduce future drift when onboard messaging or env behavior changes.

Also applies to: 149-150

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/test-onboard-repair.sh` around lines 137 - 143, Extract the
duplicated Phase-2 fault-injection setup and its explanatory comments from
test-onboard-repair.sh and test-onboard-resume.sh into a single helper (e.g., an
executable script or sourced function named setup_phase2_fault_injection or
e2e_onboard_fault_helper) that exports the same environment variables
(NEMOCLAW_POLICY_MODE=custom and the related settings) and documents the
rationale; then replace the duplicated blocks in both test-onboard-repair.sh and
test-onboard-resume.sh with a single call/source to that helper so both tests
share the same implementation and comments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/e2e/test-onboard-repair.sh`:
- Around line 137-143: Extract the duplicated Phase-2 fault-injection setup and
its explanatory comments from test-onboard-repair.sh and test-onboard-resume.sh
into a single helper (e.g., an executable script or sourced function named
setup_phase2_fault_injection or e2e_onboard_fault_helper) that exports the same
environment variables (NEMOCLAW_POLICY_MODE=custom and the related settings) and
documents the rationale; then replace the duplicated blocks in both
test-onboard-repair.sh and test-onboard-resume.sh with a single call/source to
that helper so both tests share the same implementation and comments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 606ea559-fcf9-428b-aad9-ce1c2e2d8cd7

📥 Commits

Reviewing files that changed from the base of the PR and between 9113dca and d3fd8d1.

📒 Files selected for processing (2)
  • test/e2e/test-onboard-repair.sh
  • test/e2e/test-onboard-resume.sh

…rd-repair

- onboard-resume: inference step is skipped (not re-run) on resume when
  already configured; accept both [resume] Skipping and [4/7] patterns
- onboard-repair: step numbering is [6/8] not [5/7]; match 'Creating
  sandbox' without hardcoded step number
- onboard-repair: re-create interrupted session state before Phase 4/5
  conflict tests, since Phase 3's successful resume sets resumable=false
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 25089651902
Branch: fix/onboard-e2e-fault-injection
Requested jobs: onboard-repair-e2e,onboard-resume-e2e
Summary: 0 passed, 0 failed, 22 skipped

Job Result
cloud-e2e ⏭️ skipped
cloud-inference-e2e ⏭️ skipped
cloud-onboard-e2e ⏭️ skipped
deployment-services-e2e ⏭️ skipped
diagnostics-e2e ⏭️ skipped
docs-validation-e2e ⏭️ skipped
gpu-e2e ⏭️ skipped
hermes-e2e ⏭️ skipped
inference-routing-e2e ⏭️ skipped
messaging-providers-e2e ⏭️ skipped
network-policy-e2e ⏭️ skipped
overlayfs-autofix-e2e ⏭️ skipped
rebuild-hermes-e2e ⏭️ skipped
rebuild-openclaw-e2e ⏭️ skipped
sandbox-operations-e2e ⏭️ skipped
sandbox-survival-e2e ⏭️ skipped
shields-config-e2e ⏭️ skipped
skill-agent-e2e ⏭️ skipped
skip-permissions-e2e ⏭️ skipped
snapshot-commands-e2e ⏭️ skipped
token-rotation-e2e ⏭️ skipped
upgrade-stale-sandbox-e2e ⏭️ skipped

@cv
cv merged commit ccfdbe8 into main Apr 29, 2026
51 checks passed
DemianHeyGen pushed a commit to DemianHeyGen/NemoClaw that referenced this pull request Apr 30, 2026
…d-resume tests (NVIDIA#2657)

## Summary

Fixes the persistent `onboard-repair-e2e` and `onboard-resume-e2e`
nightly failures by replacing a broken fault injection mechanism. **Zero
product code changes** — test-only fix.

## Problem

Both tests create interrupted onboard state by setting
`NEMOCLAW_POLICY_MODE=invalid`, expecting onboard to `process.exit(1)`
at the policy step. PR NVIDIA#2434 (merged Apr 24) intentionally changed this
behavior: invalid policy modes now `console.warn()` and fall back to
suggested presets instead of hard-failing. Onboard completes
successfully (exit 0) where the tests expect exit 1.

Both tests have failed in **every nightly run** since PR NVIDIA#2607 wired
them into the pipeline on Apr 28.

## Fix

Replace `NEMOCLAW_POLICY_MODE=invalid` with
`NEMOCLAW_POLICY_MODE=custom` (without setting
`NEMOCLAW_POLICY_PRESETS`). This uses a **real, stable validation path**
in `setupPoliciesWithSelection()`:

```typescript
if (policyMode === "custom" || policyMode === "list") {
  chosen = parsePolicyPresetEnv(process.env.NEMOCLAW_POLICY_PRESETS || "");
  if (chosen.length === 0) {
    console.error("  NEMOCLAW_POLICY_PRESETS is required when NEMOCLAW_POLICY_MODE=custom.");
    process.exit(1);  // ← still a hard exit, as it should be
  }
}
```

This is correct product behavior (custom mode requires presets), and it
triggers the same `process.exit(1)` → session `markStepFailed()` flow
the tests need.

## Changes

- `test/e2e/test-onboard-repair.sh`: Replace
`NEMOCLAW_POLICY_MODE=invalid` → `NEMOCLAW_POLICY_MODE=custom` +
`NEMOCLAW_POLICY_PRESETS=""`, update assertion
- `test/e2e/test-onboard-resume.sh`: Same change

## Testing

These tests run as `onboard-repair-e2e` and `onboard-resume-e2e` in the
nightly pipeline. Requesting a nightly dispatch to validate.

## Related

- NVIDIA#2573 — ci(nightly-e2e): add onboard negative-path E2E test (tracks
this fix)
- NVIDIA#2434 — fix(onboard): fall back to tier suggestions on bad
NEMOCLAW_POLICY_MODE (the change that broke the old injection)
- NVIDIA#2607 — fix(ci): wire 6 unwired E2E scripts into nightly pipeline
(wired these tests)
- NVIDIA#446 — nemoclaw onboard is not resumable (consolidated into NVIDIA#2573, now
closed)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Updated end-to-end flows to induce policy-step validation via a custom
mode with empty presets and expect the corresponding validation message.
* Broadened resume verification to accept either re-running or
explicitly skipping inference.
  * Made sandbox-creation checks more generic.
* Added an extra interrupted re-creation run to exercise
conflict-detection on resume.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance and removed CI/CD chore Build, CI, dependency, or tooling maintenance labels Jun 3, 2026
@jyaunches
jyaunches deleted the fix/onboard-e2e-fault-injection branch June 12, 2026 13:53
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 bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants