test(cli): speed up startup auto-pair tests#4913
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR improves deadline-aware testing in the auto-pair watcher by introducing a bounded test clock that advances simulated time on sleep calls, and tightens two existing watcher timeout tests to exercise deadline logic with stricter parameters. The test file size budget is updated to reflect the net reduction in lines. ChangesWatcher Timeout Testing and Time Mocking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 0 nice ideas Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
## Summary This PR trims the next slow subprocess-heavy CLI target after #4913 by removing avoidable test-time waits from sandbox connect route repair and the stuck-sandbox timeout fixture. In the profiled six-file slow bucket, wall-clock runtime dropped from 28.07s to 12.14s locally. ## Related Issue Part of #4892 ## Changes - Skip `sleepSync` route-repair backoff waits when CLI subprocesses run under Vitest or `NEMOCLAW_TEST_NO_SLEEP=1`, matching the existing inference probe test-wait convention. - Keep the route-repair production retry contract intact; the unit tests still assert the real 3-attempt, 2s-delay probe options. - Reduce the stuck Provisioning subprocess fixture from a 3s connect timeout to the shortest accepted 1s timeout. ## Type of Change - [x] 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) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Improved test execution performance by skipping sleep operations during test runs. * Reduced test execution time for sandbox connectivity validation tests. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Speeds up the next CLI runtime target by replacing the auto-pair watcher's test-only wall-clock waits with a local fake clock. The PR keeps the real subprocess timeout regression coverage, shortens those timeout windows, and ratchets the
test/nemoclaw-start.test.tslegacy size budget down after trimming lines.Related Issue
Part of #4892
Changes
time.time()andtime.sleep()inside the embedded auto-pair watcher harness to deterministic test helpers, without monkey-patching Python subprocess internals.test/nemoclaw-start.test.tsinci/test-file-size-budget.jsonfrom 5310 to 5300 lines.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit