mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 04:36:40 +00:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user