Skip to content

test(e2e): fix nightly fixtures and diagnose Hermes loss - #6831

Merged
cv merged 6 commits into
mainfrom
codex/fix-release-e2e-deterministic-failures
Jul 14, 2026
Merged

test(e2e): fix nightly fixtures and diagnose Hermes loss#6831
cv merged 6 commits into
mainfrom
codex/fix-release-e2e-deterministic-failures

Conversation

@cjagwani

@cjagwani cjagwani commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses the five release/nightly E2E blockers according to the evidence each failure left behind. The OpenShell version-pin fixture now supports the installer's archive validation calls, the Shields target restores lockdown after its intentional failure assertion, MCP patch failures preserve their real sandbox phase, and the Hermes rebuild target emits secret-safe phase and host-resource heartbeats.

The Hermes failure was not the fixture's 45-minute rebuild timeout. GitHub ended the job after about 50 minutes because the hosted runner lost communication; the rebuild command began later in the scenario and could not yet have reached its own timeout. No final logs or artifacts survived, so the underlying memory, disk, CPU, network, or runner-termination trigger cannot be recovered from that run.

Follow-up to #6744 and #6724.

The source nightly had seven red jobs. A same-SHA rerun cleared the two accepted flakes, hermes-shields-config and gateway-guard-recovery, leaving five release blockers: openshell-version-pin, shields-config, mcp-bridge, rebuild-hermes, and channels-stop-start (hermes). This PR fixes the two reproducible fixture defects, repairs the MCP phase evidence, and instruments the Hermes rebuild runner loss. mcp-bridge failed when Docker stop exceeded its 30-second client timeout after a successful image build, while channels-stop-start (hermes) was externally canceled before any assertion or artifact; neither has evidence for a causal retry or timeout change, so both still require a fresh green candidate run or a reproducible product defect.

Changes

  • Model tar -tzf, tar -tvzf, and extraction in the hermetic OpenShell version-pin fixture so the installer can validate fake release archives before extracting them.
  • Restore Shields lockdown after the duplicate-down rejection assertion and register a strict relock cleanup that reports a failed command or missing lockdown confirmation before continuing destruction.
  • Parse modern NAME CREATED PHASE OpenShell rows with the shared sandbox-list parser so MCP Docker-patch diagnostics report Provisioning instead of the creation date, while retaining the canonical terminal Evicted phase.
  • Emit a one-minute Hermes rebuild heartbeat from setup through cleanup with the active phase, child-output age, memory, process RSS, workspace disk, and load average. The output observer records timestamps only and never forwards command output or credentials.
  • Map the changed OpenShell and Hermes live targets to their fast PR coverage in the mock/live parity manifest.
  • Keep installer recovery behavior, the 30-second destructive Docker-operation timeout, Shields behavior, sandbox destruction, and Hermes rebuild behavior unchanged; the 90-minute workflow limit and 45-minute rebuild-command limit are unchanged.
  • Keep the underlying mcp-bridge Docker timeout and channels-stop-start (hermes) cancellation as explicit green-evidence blockers instead of masking them with retries.

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: all changes are internal E2E fixture, diagnostic, and parity corrections; no user-facing CLI, policy, lifecycle, installer, or Hermes contract 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: the Shields security E2E target and secret-safe Hermes diagnostics changed; review is pending on the current revision and no waiver is requested.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: no waiver is requested; required PR CI is pending.

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — OpenShell version-pin live fixture (3/3); focused archive-safety installer tests (9/9); MCP Docker-patch and shared phase parsing (29/29); Hermes progress and cleanup tests (15/15); mock/live parity guard; Vitest project membership; source-shape check; CLI typecheck and build; Shields and Hermes live target collection.
  • 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 to narrow live-target fixture and diagnostic changes. An exploratory local E2E-support run passed 979 tests and hit 15 environment-specific failures (macOS Bash behavior, Node 26 warning output, and nested-run timeouts); required Linux CI remains authoritative.
  • 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: Charan Jagwani cjagwani@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved sandbox status detection across modern list output formats, including evicted sandboxes.
    • Improved cleanup behavior so shield restoration failures are reported while subsequent cleanup continues.
    • Strengthened shield-state handling during test teardown.
  • User Experience

    • Added clearer progress and activity reporting during lengthy Hermes rebuild operations.
  • Tests

    • Expanded coverage for installer version pinning, sandbox lifecycle states, cleanup ordering, and rebuild progress reporting.

@cjagwani cjagwani self-assigned this Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 3731c293-7da9-4f35-8e3e-5e8eb612ae84

📥 Commits

Reviewing files that changed from the base of the PR and between df67406 and effb7eb.

📒 Files selected for processing (4)
  • src/lib/onboard/docker-gpu-patch-diagnostics-classification.test.ts
  • src/lib/onboard/docker-gpu-patch.ts
  • src/lib/runtime-recovery.test.ts
  • src/lib/runtime-recovery.ts

📝 Walkthrough

Walkthrough

The live E2E changes update installer tar stubbing and shields restoration, add Hermes rebuild progress tracking and validation, register related mock-parity tests, and improve sandbox phase parsing for modern output and Evicted states.

Changes

E2E reliability and progress reporting

Layer / File(s) Summary
Installer and lockdown fixture handling
test/e2e/live/openshell-version-pin.test.ts, test/e2e/live/shields-config.test.ts, test/e2e/support/e2e-cleanup-resources.test.ts
The fake tar handles archive-derived binaries and tar modes; shields teardown restores lockdown; cleanup tests verify continuation after restoration failure.
Progress controller and diagnostics
test/e2e/live/rebuild-hermes-progress.ts
Adds injectable phase tracking, heartbeat logging, resource diagnostics, output liveness tracking, and timer cleanup.
Hermes rebuild integration and validation
test/e2e/live/rebuild-hermes.test.ts, test/e2e/support/rebuild-hermes-progress.test.ts, test/e2e/mock-parity.json
Adds rebuild phase markers and command output wiring, tests progress sequencing and failure resilience, and registers the related tests.
Sandbox phase parsing
src/lib/onboard/docker-gpu-patch.ts, src/lib/onboard/docker-gpu-patch-diagnostics-classification.test.ts, src/lib/runtime-recovery.ts, src/lib/runtime-recovery.test.ts
Uses shared live sandbox entries for phase lookup and recognizes and preserves the Evicted phase in list output.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RebuildHermesTest
  participant ProgressTracker
  participant LongRunningCommand
  participant ResourceSampler
  RebuildHermesTest->>ProgressTracker: advance phase
  RebuildHermesTest->>LongRunningCommand: run command with onOutput
  LongRunningCommand->>ProgressTracker: report output
  ProgressTracker->>ResourceSampler: sample host resources
  ResourceSampler-->>ProgressTracker: return snapshot
  ProgressTracker-->>RebuildHermesTest: emit heartbeat
  RebuildHermesTest->>ProgressTracker: stop during cleanup
Loading

Possibly related PRs

Suggested labels: area: e2e, integration: hermes, bug-fix

Suggested reviewers: cv, ericksoa

🚥 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 is concise and matches the main changes: E2E fixture fixes plus Hermes rebuild loss diagnostics.
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.
✨ 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/fix-release-e2e-deterministic-failures

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

@github-code-quality

github-code-quality Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.


Updated July 14, 2026 06:50 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cjagwani cjagwani changed the title test(e2e): fix deterministic nightly failures test(e2e): fix nightly fixtures and diagnose Hermes loss Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Primary next action: No advisor follow-up required beyond maintainer review.
Findings: 0 blockers · 0 warnings · 0 optional suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (non-blocking second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; severity counts match.

Nemotron is a non-blocking second opinion. Its prose, findings, and E2E guidance do not change the primary assessment above and remain in workflow artifacts only.

Since last review: 0 prior items resolved · 0 still apply · 0 new items found

E2E guidance

Advisory only: coverage and selector recommendations are non-authoritative. E2E / PR Gate independently computes and dispatches trusted jobs without consuming this output.

Recommended coverage: cloud-onboard, credential-sanitization, security-posture, onboard-repair, onboard-resume, openshell-version-pin, rebuild-hermes, rebuild-hermes-stale-base, shields-config
Recommended selectors: cloud-onboard, credential-sanitization, security-posture, onboard-repair, onboard-resume, openshell-version-pin, rebuild-hermes, rebuild-hermes-stale-base, shields-config

  • cloud-onboard — Selected from the trusted checked-in E2E coverage inventory.

  • credential-sanitization — Selected from the trusted checked-in E2E coverage inventory.

  • security-posture — Selected from the trusted checked-in E2E coverage inventory.

  • onboard-repair — Selected from the trusted checked-in E2E coverage inventory.

  • onboard-resume — Selected from the trusted checked-in E2E coverage inventory.

  • openshell-version-pin — Selected from the trusted checked-in E2E coverage inventory.

  • rebuild-hermes — Selected from the trusted checked-in E2E coverage inventory.

  • rebuild-hermes-stale-base — Selected from the trusted checked-in E2E coverage inventory.

  • shields-config — Selected from the trusted checked-in E2E coverage inventory.

  • cloud-onboard — Selected as a trusted checked-in E2E job.

  • credential-sanitization — Selected as a trusted checked-in E2E job.

  • security-posture — Selected as a trusted checked-in E2E job.

  • onboard-repair — Selected as a trusted checked-in E2E job.

  • onboard-resume — Selected as a trusted checked-in E2E job.

  • openshell-version-pin — Selected as a trusted checked-in E2E job.

  • rebuild-hermes — Selected as a trusted checked-in E2E job.

  • rebuild-hermes-stale-base — Selected as a trusted checked-in E2E job.

  • shields-config — Selected as a trusted checked-in E2E job.

1 optional coverage item · 1 optional selector · 0 new-test recommendations
  • Optional coverage full-e2e — Selected from the trusted checked-in E2E coverage inventory.
  • Optional selector full-e2e — Selected as a trusted checked-in E2E job.

Workflow run details

This is an automated, non-authoritative review. Findings are inputs to maintainer adjudication. Warnings and optional suggestions do not require a response or follow-up. A human maintainer makes the final merge decision.

@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/support/rebuild-hermes-progress.test.ts (1)

39-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a case for phase() called after stop().

Coverage is solid, but the if (stopped) return; guard in phase() (rebuild-hermes-progress.ts) is never directly exercised here — only indirectly via ordering assumptions in the live test. A short additional case (progress.stop(); progress.phase("x"); expect(state.lines).toHaveLength(<unchanged>);) would lock in that guard.

🤖 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/support/rebuild-hermes-progress.test.ts` around lines 39 - 77, Add a
focused test in the “Hermes rebuild live progress” suite that starts progress,
calls stop(), then invokes phase() and verifies no additional log lines are
emitted. Use the existing progressHarness and state.lines assertions to directly
cover the stopped guard in phase().
🤖 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 `@test/e2e/support/rebuild-hermes-progress.test.ts`:
- Around line 39-77: Add a focused test in the “Hermes rebuild live progress”
suite that starts progress, calls stop(), then invokes phase() and verifies no
additional log lines are emitted. Use the existing progressHarness and
state.lines assertions to directly cover the stopped guard in phase().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c84c3cbe-2c31-4c28-b9e0-6f30437e11a5

📥 Commits

Reviewing files that changed from the base of the PR and between 2f14e70 and 15ccb25.

📒 Files selected for processing (4)
  • test/e2e/live/rebuild-hermes-progress.ts
  • test/e2e/live/rebuild-hermes.test.ts
  • test/e2e/mock-parity.json
  • test/e2e/support/rebuild-hermes-progress.test.ts

cjagwani added 2 commits July 13, 2026 23:19
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@cv cv added the v0.0.83 label Jul 14, 2026
@cv cv added v0.0.82 and removed v0.0.83 labels Jul 14, 2026
@cv
cv merged commit 2adc848 into main Jul 14, 2026
79 of 80 checks passed
@cv
cv deleted the codex/fix-release-e2e-deterministic-failures branch July 14, 2026 06:53
@wscurran wscurran added area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: hermes Hermes integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants