Skip to content

test(onboard): isolate gateway recovery fixture#7516

Merged
jyaunches merged 3 commits into
mainfrom
codex/gateway-recovery-unit-flake
Jul 25, 2026
Merged

test(onboard): isolate gateway recovery fixture#7516
jyaunches merged 3 commits into
mainfrom
codex/gateway-recovery-unit-flake

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Gateway-recovery unit tests no longer invoke the host's production docker info runtime probe or busy-loop against real wall-clock deadlines. The fixture now owns a deterministic runtime value and virtual clock, preserving the same recovery assertions while reducing focused test execution from 4.02 seconds to 16 milliseconds.

Related Issue

Part of #7140.

Changes

  • Stub the container runtime in the shared gateway-recovery test fixture so a healthy unit path cannot inherit Docker's 5-second probe timeout.
  • Pair the fixture's mocked sleeper with its existing virtual clock so failed probes advance deterministically instead of spinning against Date.now().
  • Keep specialized per-test overrides authoritative and preserve every existing recovery, validation, and lifecycle-authority assertion.

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: all 14 gateway-recovery tests execute through the changed shared fixture and retain their existing assertions.
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this changes test isolation and timing only; production and user-facing behavior are unchanged.
  • 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: Independent Codex Desktop review of exact head f34bc4bae against base 3c88ec303 passed with no findings. No production code or assertions changed; fail-closed gateway validation and lifecycle-authority coverage remain intact.
  • 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: Test-only fixture stabilization in src/lib/onboard/gateway-recovery.test.ts; no production or user-facing behavior changed. Focused tests: 14/14 pass; file execution 4.02s -> 16ms.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

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

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 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 — npx vitest run --project cli src/lib/onboard/gateway-recovery.test.ts --reporter=verbose: 14/14 passed; npm run typecheck:cli, npm run test:titles:check, and npm run source-shape:check passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — not run for this one-file unit-fixture change; GitHub CI is the broad gate.
  • 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
    • Improved gateway recovery test timing with deterministic virtual-clock behavior.
    • Updated mocked sleep handling to accurately advance time during recovery scenarios.

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

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: c23eff7f-d59d-493c-aade-e5a9d916d6f9

📥 Commits

Reviewing files that changed from the base of the PR and between 3c88ec3 and f34bc4b.

📒 Files selected for processing (1)
  • src/lib/onboard/gateway-recovery.test.ts

📝 Walkthrough

Walkthrough

Gateway recovery tests now construct a virtual clock by default, use it for sleeping, and expose its time reader through GatewayRecoveryDeps.

Changes

Gateway recovery test timing

Layer / File(s) Summary
Virtual clock dependency wiring
src/lib/onboard/gateway-recovery.test.ts
createDeps connects virtual-clock sleeping and time reads to the recovery dependencies, replacing the standalone sleep mock.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#7246: Updates gateway recovery test dependency wiring and coverage in the same test file.

Suggested reviewers: jyaunches

🚥 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 clearly matches the main change: isolating the gateway recovery test fixture.
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/gateway-recovery-unit-flake

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

@apurvvkumaria apurvvkumaria added area: ci CI workflows, checks, release automation, or GitHub Actions area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow v0.0.96 Release target labels Jul 25, 2026
@github-code-quality

github-code-quality Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit b04f836 in the codex/gateway-recove... branch remains at 96%, unchanged from commit f9b28cc in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit b04f836 in the codex/gateway-recove... branch remains at 80%, unchanged from commit 1f40cd3 in the main branch.

Show a code coverage summary of the most impacted files.
File main 1f40cd3 codex/gateway-recove... b04f836 +/-
src/lib/platform.ts 89% 84% -5%
src/lib/inferen...del-registry.ts 100% 97% -3%
src/lib/onboard...nce-topology.ts 81% 79% -2%
src/lib/adapter.../auth-config.ts 96% 96% 0%
src/lib/inferen...lama-version.ts 100% 100% 0%
src/lib/messagi...nnels/policy.ts 100% 100% 0%
src/lib/onboard...way-recovery.ts 93% 93% 0%
src/lib/state/m...-acquisition.ts 87% 89% +2%
src/lib/inferen...time-context.ts 87% 93% +6%
src/lib/domain/.../connect-env.ts 89% 97% +8%

Updated July 25, 2026 08:45 UTC

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 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 (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; 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-onboard

1 optional E2E recommendation
  • gateway-guard-recovery

Workflow run details

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

@apurvvkumaria apurvvkumaria self-assigned this Jul 25, 2026
@jyaunches
jyaunches merged commit dbac677 into main Jul 25, 2026
54 checks passed
@jyaunches
jyaunches deleted the codex/gateway-recovery-unit-flake branch July 25, 2026 17:06
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: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow v0.0.96 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants