test(e2e): add #2174 port auto-alloc assertions to double-onboard#2709
Conversation
Adds two assertions to Phase 4 of test-double-onboard.sh that verify:
- Second-sandbox onboard logs port auto-allocation ("is taken. Using port")
- nemoclaw list shows two distinct dashboard ports for both sandboxes
These guard against silent regression of the auto-alloc path introduced
in #2411. The double-onboard-e2e nightly job already runs this script —
no workflow changes needed.
Supersedes #2455 (which had a stale assertion string and conflicting
workflow changes).
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
📝 WalkthroughWalkthroughTest enhancements add e2e assertions for regression Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
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-double-onboard.sh`:
- Around line 418-429: The assertion counts all global dashboard entries;
restrict it to sandboxes created in this test by filtering the list output for
the sandbox identifiers you spawned earlier (e.g., use the variables that hold
the sandbox names/IDs instead of the whole run_nemoclaw list output). After
run_nemoclaw list >"$LIST_LOG" capture list_output as you do, then narrow it
with grep -E "(${SANDBOX_NAME1}|${SANDBOX_NAME2})" (or the variables that hold
the test sandbox IDs) before computing dashboard_ports_in_list and
distinct_count so dashboard_ports_in_list only contains ports for the sandboxes
under test (keep using the existing variables LIST_LOG, list_output,
dashboard_ports_in_list, distinct_count). Ensure the failure message still
prints the filtered dashboard_ports_in_list for debugging.
🪄 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: Enterprise
Run ID: bdaa3c63-c0c0-420b-b527-26da412b5db8
📒 Files selected for processing (1)
test/e2e/test-double-onboard.sh
| LIST_LOG="$(mktemp)" | ||
| run_nemoclaw list >"$LIST_LOG" 2>&1 || true | ||
| list_output="$(cat "$LIST_LOG")" | ||
| rm -f "$LIST_LOG" | ||
|
|
||
| dashboard_ports_in_list="$(grep -oE 'dashboard: http://127\.0\.0\.1:[0-9]+' <<<"$list_output" | awk -F: '{print $NF}' | sort -u)" | ||
| distinct_count="$(wc -l <<<"$dashboard_ports_in_list" | tr -d ' ')" | ||
| if [ "$distinct_count" = "2" ]; then | ||
| pass "nemoclaw list shows two distinct dashboard ports (#2174)" | ||
| else | ||
| fail "nemoclaw list did not show two distinct dashboard ports (got $distinct_count: $(tr '\n' ' ' <<<"$dashboard_ports_in_list"))" | ||
| fi |
There was a problem hiding this comment.
Scope the list assertion to the sandboxes under test.
run_nemoclaw list is global, so counting every dashboard: entry can fail or pass because of unrelated sandboxes or stale registry state. That weakens the #2174 regression check.
Suggested cleanup
LIST_LOG="$(mktemp)"
-run_nemoclaw list >"$LIST_LOG" 2>&1 || true
+if ! run_nemoclaw list >"$LIST_LOG" 2>&1; then
+ fail "nemoclaw list failed"
+fi
list_output="$(cat "$LIST_LOG")"
rm -f "$LIST_LOG"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| LIST_LOG="$(mktemp)" | |
| run_nemoclaw list >"$LIST_LOG" 2>&1 || true | |
| list_output="$(cat "$LIST_LOG")" | |
| rm -f "$LIST_LOG" | |
| dashboard_ports_in_list="$(grep -oE 'dashboard: http://127\.0\.0\.1:[0-9]+' <<<"$list_output" | awk -F: '{print $NF}' | sort -u)" | |
| distinct_count="$(wc -l <<<"$dashboard_ports_in_list" | tr -d ' ')" | |
| if [ "$distinct_count" = "2" ]; then | |
| pass "nemoclaw list shows two distinct dashboard ports (#2174)" | |
| else | |
| fail "nemoclaw list did not show two distinct dashboard ports (got $distinct_count: $(tr '\n' ' ' <<<"$dashboard_ports_in_list"))" | |
| fi | |
| LIST_LOG="$(mktemp)" | |
| if ! run_nemoclaw list >"$LIST_LOG" 2>&1; then | |
| fail "nemoclaw list failed" | |
| fi | |
| list_output="$(cat "$LIST_LOG")" | |
| rm -f "$LIST_LOG" | |
| dashboard_ports_in_list="$(grep -oE 'dashboard: http://127\.0\.0\.1:[0-9]+' <<<"$list_output" | awk -F: '{print $NF}' | sort -u)" | |
| distinct_count="$(wc -l <<<"$dashboard_ports_in_list" | tr -d ' ')" | |
| if [ "$distinct_count" = "2" ]; then | |
| pass "nemoclaw list shows two distinct dashboard ports (`#2174`)" | |
| else | |
| fail "nemoclaw list did not show two distinct dashboard ports (got $distinct_count: $(tr '\n' ' ' <<<"$dashboard_ports_in_list"))" | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@test/e2e/test-double-onboard.sh` around lines 418 - 429, The assertion counts
all global dashboard entries; restrict it to sandboxes created in this test by
filtering the list output for the sandbox identifiers you spawned earlier (e.g.,
use the variables that hold the sandbox names/IDs instead of the whole
run_nemoclaw list output). After run_nemoclaw list >"$LIST_LOG" capture
list_output as you do, then narrow it with grep -E
"(${SANDBOX_NAME1}|${SANDBOX_NAME2})" (or the variables that hold the test
sandbox IDs) before computing dashboard_ports_in_list and distinct_count so
dashboard_ports_in_list only contains ports for the sandboxes under test (keep
using the existing variables LIST_LOG, list_output, dashboard_ports_in_list,
distinct_count). Ensure the failure message still prints the filtered
dashboard_ports_in_list for debugging.
…rd (NVIDIA#2709) ## Summary Adds two regression assertions to Phase 4 of `test-double-onboard.sh` that verify the NVIDIA#2174 auto-allocation fix works end-to-end: 1. **Log check** — Second-sandbox onboard output contains `"is taken. Using port"` (confirms `ensureDashboardForward` auto-allocated) 2. **List check** — `nemoclaw list` shows two distinct `dashboard: http://127.0.0.1:<port>` entries for both sandboxes ## Related - Guards against regression of NVIDIA#2174 (fix landed via NVIDIA#2411 + NVIDIA#2627) - Supersedes NVIDIA#2455 (which had a stale assertion string `"allocated port"` that doesn't match any runtime output, and conflicting workflow changes already on main) ## Changes - `test/e2e/test-double-onboard.sh` — 21 lines added between the existing NVIDIA#849 regression check and Phase 5 ## Why this supersedes NVIDIA#2455 | Issue | NVIDIA#2455 | This PR | |-------|-------|---------| | Assertion string | `"allocated port"` (doesn't exist in codebase) | `"is taken. Using port"` (matches `ensureDashboardForward` line ~6600) | | Workflow changes | Adds a `double-onboard-e2e` job that already exists on main → merge conflict | None needed — job already runs this script | | Branch freshness | 95 commits behind main | Based on current main | ## Type of Change - [x] Code change (feature, bug fix, or refactor) ## Verification - [x] `bash -n test/e2e/test-double-onboard.sh` — syntax check passes - [x] shellcheck clean - [x] No workflow changes needed — `double-onboard-e2e` nightly job already runs this script - [x] No secrets, API keys, or credentials committed ## AI Disclosure - [x] AI-assisted — tool: Claude (pi agent) --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added end-to-end test assertions for multi-sandbox onboarding scenarios * Validates dashboard port auto-allocation prevents conflicts and maintains isolation across concurrent sandbox environments <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Summary
Adds two regression assertions to Phase 4 of
test-double-onboard.shthat verify the #2174 auto-allocation fix works end-to-end:"is taken. Using port"(confirmsensureDashboardForwardauto-allocated)nemoclaw listshows two distinctdashboard: http://127.0.0.1:<port>entries for both sandboxesRelated
"allocated port"that doesn't match any runtime output, and conflicting workflow changes already on main)Changes
test/e2e/test-double-onboard.sh— 21 lines added between the existing Cannot connect to the first sandbox after creating the second sandbox #849 regression check and Phase 5Why this supersedes #2455
"allocated port"(doesn't exist in codebase)"is taken. Using port"(matchesensureDashboardForwardline ~6600)double-onboard-e2ejob that already exists on main → merge conflictType of Change
Verification
bash -n test/e2e/test-double-onboard.sh— syntax check passesdouble-onboard-e2enightly job already runs this scriptAI Disclosure
Signed-off-by: Julie Yaunches jyaunches@nvidia.com
Summary by CodeRabbit