From 7b755227d50a9f64a3ff5b3f920250d29cab0a2a Mon Sep 17 00:00:00 2001 From: joshsiv-mulga Date: Fri, 15 May 2026 12:41:49 +1000 Subject: [PATCH] fix(e2e): NATS peer count expects NODE_COUNT-1 routes not hardcoded 2 /routez reports outbound routes; with N nodes each node has N-1 routes. A 2-node cluster has 1 route, not 2. Test was written for 3-node tofu cluster and failed on 2-node baremetal. --- tests/e2e/run-bm-multinode-e2e.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/run-bm-multinode-e2e.sh b/tests/e2e/run-bm-multinode-e2e.sh index 10984acb0..507bc61d2 100755 --- a/tests/e2e/run-bm-multinode-e2e.sh +++ b/tests/e2e/run-bm-multinode-e2e.sh @@ -437,8 +437,9 @@ NATS_INFO=$(curl -s "http://127.0.0.1:${NATS_MONITOR_PORT}/routez" 2>/dev/null) exit 1 } UNIQUE_PEERS=$(echo "$NATS_INFO" | jq -r '[.routes[].remote_name] | unique | length') -echo " NATS unique peers: $UNIQUE_PEERS (expected: 2)" -if [ "$UNIQUE_PEERS" -ge 2 ]; then +EXPECTED_PEERS=$((NODE_COUNT - 1)) +echo " NATS unique peers: $UNIQUE_PEERS (expected: $EXPECTED_PEERS)" +if [ "$UNIQUE_PEERS" -ge "$EXPECTED_PEERS" ]; then pass_test "NATS quorum" else echo " ERROR: NATS cluster not fully formed"