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.
This commit is contained in:
joshsiv-mulga
2026-05-15 12:41:49 +10:00
parent f667e2e0a6
commit 7b755227d5
+3 -2
View File
@@ -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"