Skip to content

fix(test): skip TC-SBX-06 on runners with < 4 vCPUs#1919

Draft
TruongNguyenG wants to merge 2 commits intoNVIDIA:mainfrom
TruongNguyenG:fix/skip-sbx06-weak-runner
Draft

fix(test): skip TC-SBX-06 on runners with < 4 vCPUs#1919
TruongNguyenG wants to merge 2 commits intoNVIDIA:mainfrom
TruongNguyenG:fix/skip-sbx06-weak-runner

Conversation

@TruongNguyenG
Copy link
Copy Markdown
Contributor

@TruongNguyenG TruongNguyenG commented Apr 15, 2026

Summary

Gate TC-SBX-06 (gateway auto-recovery after docker kill) on CPU count so it skips gracefully on weak runners (ubuntu-latest, 2 vCPU) and auto-enables on stronger ones (≥4 cores). The function is preserved, not removed.

Related Issue

Fixes #1909

Changes

  • Gate test_sbx_06_gateway_recovery call on nproc ≥ 4 in the Phase 3 section of test-sandbox-operations.sh
  • When below threshold, log a skip message referencing issue Gateway auto-recovery times out on ubuntu-latest runners #1909
  • No change to the function body — it runs automatically when a suitable runner is available

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)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make 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)

AI Disclosure

  • AI-assisted — tool: Cursor

Signed-off-by: Truong Nguyen tgnguyen@nvidia.com

Summary by CodeRabbit

  • Tests
    • Test suite now detects available CPU cores and conditionally skips resource-intensive tests that require 4+ vCPUs, logging the detected core count and skip reason when run on smaller machines. Detection includes multiple platform fallbacks and input sanitization to ensure reliable behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 42488a6e-627c-49cd-a1af-a989d1e44695

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The end-to-end test script was modified to detect runner vCPU count and only execute test_sbx_06_gateway_recovery when vCPUs ≥ 4; otherwise the test is logged and marked skipped with the detected vCPU count.

Changes

Cohort / File(s) Summary
Test Conditional Skip Logic
test/e2e/test-sandbox-operations.sh
Add vCPU detection (tries nproc, falls back to gnproc, getconf, sysctl, default 2), sanitize to digits, and gate execution of test_sbx_06_gateway_recovery to run only when vcpus >= 4; otherwise log TC‑SBX‑06 header and mark test skipped with vCPU info.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I counted cores with nimble paws,
Then paused the test for quieter jaws.
If four or more, we'll romp and play —
If fewer, gentle skip today.
A hop, a note, CI stays sane!

🚥 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 and concisely describes the main change: skipping TC-SBX-06 on runners with fewer than 4 vCPUs, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR fully addresses the linked issue #1909 by implementing the CPU-count gating mechanism to skip TC-SBX-06 on weak runners (< 4 vCPUs) while preserving the test for suitable environments.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objective: adding CPU detection and conditional logic to gate TC-SBX-06 execution in the test script with no unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@TruongNguyenG
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/e2e/test-sandbox-operations.sh`:
- Around line 684-690: vCPU detection currently uses nproc with a static
fallback of 2 causing false skips on platforms without nproc; update the logic
that sets the vcpus variable (used to decide calling
test_sbx_06_gateway_recovery vs skip and logged via log/skip) to detect cores
cross-platform by trying nproc, then getconf _NPROCESSORS_ONLN, then sysctl -n
hw.ncpu (macOS), and finally a minimal safe default only if all fail; ensure the
vcpus value is an integer before the comparison so TC-SBX-06 is not incorrectly
skipped on capable runners.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b127df12-b0f8-4dbe-8467-4df1f1cc9821

📥 Commits

Reviewing files that changed from the base of the PR and between 1d4d8a2 and 92f0cb1.

📒 Files selected for processing (1)
  • test/e2e/test-sandbox-operations.sh

Comment thread test/e2e/test-sandbox-operations.sh Outdated
TC-SBX-06 (gateway auto-recovery after docker kill) requires k3s to
restart inside the gateway container. On ubuntu-latest (2 vCPU, 7GB RAM)
this consistently times out (exit 124), while it passes in ~70s on
machines with ≥4 cores.

Gate the call on nproc so the test auto-enables on stronger runners
and skips gracefully on weak ones. The function is preserved for when
a suitable runner is available.

See: NVIDIA#1909
Made-with: Cursor
@TruongNguyenG TruongNguyenG force-pushed the fix/skip-sbx06-weak-runner branch from 92f0cb1 to 7b306d4 Compare April 15, 2026 19:47
@TruongNguyenG
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@wscurran wscurran added CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions. fix E2E End-to-end testing — Brev infrastructure, test cases, nightly failures, and coverage gaps labels Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Use this label to identify issues with NemoClaw CI/CD pipeline or GitHub Actions. E2E End-to-end testing — Brev infrastructure, test cases, nightly failures, and coverage gaps fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway auto-recovery times out on ubuntu-latest runners

2 participants