diff --git a/test/infra/control/env-isolated.bash b/test/infra/control/env-isolated.bash index 33d2b241d..4585a2258 100755 --- a/test/infra/control/env-isolated.bash +++ b/test/infra/control/env-isolated.bash @@ -59,18 +59,22 @@ export TAP_DEPS="${WORKSPACE}/test/tap/tap" export TEST_DEPS_PATH="${WORKSPACE}/test-scripts/deps" export TEST_DEPS="${TEST_DEPS_PATH}" -# Cluster Nodes — all run inside the ProxySQL container on different ports -# Port scheme: proxy-node1=6042, proxy-node2=6052, ..., proxy-node9=6122 +# Cluster Nodes — primary (6032) + nodes inside the ProxySQL container +# Port scheme: primary=6032, proxy-node1=6042, proxy-node2=6052, ..., proxy-node9=6122 # From the test-runner container, reach them via the proxysql hostname +# NOTE: primary MUST be first — test_cluster1-t expects conns[0] to be the primary NUM_CLUSTER_NODES=${PROXYSQL_CLUSTER_NODES:-9} if [[ "${SKIP_CLUSTER_START}" == "1" ]] || [[ "${SKIP_CLUSTER_START}" == "true" ]]; then NUM_CLUSTER_NODES=0 fi CLUSTER_NODES="" -for i in $(seq 1 ${NUM_CLUSTER_NODES}); do - PORT=$((6032 + i * 10)) - CLUSTER_NODES="${CLUSTER_NODES}proxysql:${PORT}," -done +if [ "${NUM_CLUSTER_NODES}" -gt 0 ]; then + CLUSTER_NODES="proxysql:6032," + for i in $(seq 1 ${NUM_CLUSTER_NODES}); do + PORT=$((6032 + i * 10)) + CLUSTER_NODES="${CLUSTER_NODES}proxysql:${PORT}," + done +fi export TAP_CLUSTER_NODES=${CLUSTER_NODES%,} # Build and runtime essentials