Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test/e2e/test-double-onboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,27 @@ else
fail "First sandbox '$SANDBOX_A' disappeared after creating '$SANDBOX_B' (regression: #849)"
fi

# #2174 regression: B must auto-allocate to a different dashboard port,
# surface it in nemoclaw list, and not collide with A's 18789.
if grep -q "is taken. Using port" <<<"$output3"; then
pass "Second-sandbox onboard logged port auto-allocation (#2174)"
else
fail "Second-sandbox onboard did not log port auto-allocation — auto-alloc may not have fired (#2174)"
fi

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
Comment on lines +418 to +429

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.


# ══════════════════════════════════════════════════════════════════
# Phase 5: Stale registry reconciliation
# ══════════════════════════════════════════════════════════════════
Expand Down
Loading