Skip to content

perf(test): parallelize fresh-create identity cases - #11343

Merged
cv merged 1 commit into
mainfrom
codex/6237-concurrent-fresh-create
Sep 9, 2026
Merged

perf(test): parallelize fresh-create identity cases#11343
cv merged 1 commit into
mainfrom
codex/6237-concurrent-fresh-create

Conversation

@cjagwani

@cjagwani cjagwani commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Outcome

The current slowest CLI coverage test file drops from 132.85s to a 47.28s three-run median locally: 64% faster, with all 15 subprocess scenarios preserved. The fresh hosted timing report measured the current-main file at 134.85s.

Production behavior is unchanged.

Reason

onboard-fresh-create-identity.test.ts runs 15 independent, process-isolated onboarding scenarios. Each case used spawnSync, so the file serialized every child process even though the scenarios use separate homes, ports, and payloads.

Related issues

Part of #6237.

Changes

  • Run the independent table cases with Vitest's existing bounded test concurrency.
  • Replace synchronous child launches with an async execFile wrapper while preserving exit status, stdout, stderr, timeout, and process isolation.
  • Move the three fixture environment variables into each child environment so concurrent cases do not share mutable test state.
  • Give each child an in-memory Docker volume fixture; it preserves the managed-state lifecycle contract without touching a real Docker daemon.

This recovers the useful distribution goal from closed PR #11098 without its 1,180-line helper extraction, four wrapper files, or shard remapping.

Verification

  • Controlled local serial run: 132.85s; 15/15 tests passed.
  • Optimized local runs: 47.28s, 65.46s, and 45.62s; median 47.28s; 15/15 tests passed each time.
  • Post-hook committed run: 58.90s; 15/15 tests passed.
  • Normal pre-commit hooks passed, including formatting, lint, repository checks, gitleaks, source-shape budget, growth guardrails, and commitlint.
  • Normal pre-push CLI TypeScript check passed.
  • GitHub marks commit 17a6d2d83703d380d63310f9951e76e871520412 Verified.
  • Documentation review found no docs change is needed because only test execution mechanics change.

Review notes

The cases remain subprocess-isolated and retain all assertions. Concurrency is bounded by Vitest rather than adding a new worker setting or CI configuration.


Signed-off-by: Charan Jagwani cjagwani@nvidia.com

Summary by CodeRabbit

  • Tests
    • Improved onboarding test coverage for fresh identity creation, recovery, cancellation, and reentry scenarios.
    • Added validation for Docker volume interactions during host-doctor checks.
    • Updated test execution to support concurrent cases and asynchronous process handling, improving reliability and consistency across environments.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview 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: 3a1c64ad-d104-49ab-af30-540c1c0ed41c

📥 Commits

Reviewing files that changed from the base of the PR and between a89af34 and 17a6d2d.

📒 Files selected for processing (1)
  • test/onboarding/onboard-fresh-create-identity.test.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The onboarding test now runs cases concurrently with asynchronous child-process execution. It isolates fixture environment variables per process, adds Docker volume fixtures for host-doctor interactions, and awaits recovery, cancellation, and reentry assertions.

Changes

Onboarding test execution

Layer / File(s) Summary
Asynchronous process setup
test/onboarding/onboard-fresh-create-identity.test.ts
The test uses an asynchronous runNodeScript helper, runs parameterized cases concurrently, passes fixture variables to child processes, and simulates Docker volume operations.
Recovery and cancellation validation
test/onboarding/onboard-fresh-create-identity.test.ts
Recovery readbacks, reentry checks, cancellation checks, and selected outcomes now await asynchronous execution and assertions.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to 17a6d

This change parallelizes isolated onboarding test scenarios and updates their child-process and recovery handling without changing production behavior. No current merge-blocking risk is identified.

Suggested reviewers: sandl99, prekshivyas

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: parallelizing the fresh-create identity test cases for performance.
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.
  • Fix all pre-merge checks with AI
✨ 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/6237-concurrent-fresh-create

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

@github-code-quality

github-code-quality Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit 17a6d2d in the codex/6237-concurren... branch remains at 96%, unchanged from commit 801fb0c in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit 17a6d2d in the codex/6237-concurren... branch remains at 83%, unchanged from commit ae5b2ca in the main branch.

Show a line coverage summary of the most impacted files.
File main ae5b2ca codex/6237-concurren... 17a6d2d +/-
src/lib/actions...ridge-output.ts 95% 89% -6%
src/lib/actions...e-validation.ts 88% 84% -4%
src/lib/actions...ard-recovery.ts 97% 95% -2%
src/lib/actions...ard-recovery.ts 85% 84% -1%
src/lib/actions...ess-recovery.ts 82% 84% +2%
src/lib/actions...eway-restart.ts 92% 94% +2%
src/lib/inferen...anaged-state.ts 82% 85% +3%
src/lib/state/o...config-merge.ts 85% 92% +7%
src/lib/actions...-diagnostics.ts 67% 81% +14%
src/lib/adapter...ider-adapter.ts 0% 100% +100%

Updated September 09, 2026 22:12 UTC

@cjagwani
cjagwani requested review from cv and prekshivyas September 9, 2026 22:14
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit 17a6d2d. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

All previous runs

@cv
cv merged commit 45df3aa into main Sep 9, 2026
69 checks passed
@cv
cv deleted the codex/6237-concurrent-fresh-create branch September 9, 2026 22:35
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.

2 participants