From 271d5ea520d9d0f4ec1ad6f26d7c6dfaf73ba9b3 Mon Sep 17 00:00:00 2001 From: xhe Date: Mon, 29 Jan 2024 13:49:52 +0800 Subject: [PATCH] cluster: add integration tests for tiproxy (#2371) --- tests/tiup-cluster/script/scale_core.sh | 18 ++++++++++++++++-- tests/tiup-cluster/script/scale_tools.sh | 12 ++++++------ tests/tiup-cluster/topo/full.yaml | 3 +++ .../topo/full_scale_in_tiproxy.yaml | 2 ++ tests/tiup-cluster/topo/full_tls.yaml | 3 +++ .../topo/full_without_tiflash.yaml | 3 +++ 6 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 tests/tiup-cluster/topo/full_scale_in_tiproxy.yaml diff --git a/tests/tiup-cluster/script/scale_core.sh b/tests/tiup-cluster/script/scale_core.sh index a026da8fda..6e173404bf 100755 --- a/tests/tiup-cluster/script/scale_core.sh +++ b/tests/tiup-cluster/script/scale_core.sh @@ -34,9 +34,13 @@ function scale_core() { tiup-cluster $client --yes reload $name --skip-restart if [ $test_tls = true ]; then - total_sub_one=18 + total_sub_one=19 + total=20 + total_add_one=21 else - total_sub_one=23 + total_sub_one=24 + total=25 + total_add_one=26 fi echo "start scale in tidb" @@ -90,6 +94,16 @@ function scale_core() { tiup-cluster $client exec $name -N n1 --command "grep -q n3:2379 /home/tidb/deploy/tidb-4000/scripts/run_tidb.sh" tiup-cluster $client exec $name -N n1 --command "grep -q n3:2379 /home/tidb/deploy/prometheus-9090/conf/prometheus.yml" + echo "start scale out tiproxy" + topo=./topo/full_scale_in_tiproxy.yaml + tiup-cluster $client --yes scale-out $name $topo + wait_instance_num_reach $name $total_add_one $native_ssh + + echo "start scale in tiproxy" + tiup-cluster $client --yes scale-in $name -N n1:6000 + wait_instance_num_reach $name $total $native_ssh + + echo "start scale in tidb" tiup-cluster $client --yes scale-in $name -N n2:4000 wait_instance_num_reach $name $total_sub_one $native_ssh diff --git a/tests/tiup-cluster/script/scale_tools.sh b/tests/tiup-cluster/script/scale_tools.sh index b42c6e395e..cfc7f15c7c 100755 --- a/tests/tiup-cluster/script/scale_tools.sh +++ b/tests/tiup-cluster/script/scale_tools.sh @@ -41,13 +41,13 @@ function scale_tools() { tiup-cluster $client display $name if [ $test_tls = true ]; then - total_sub_one=18 - total=19 - total_add_one=20 + total_sub_one=19 + total=20 + total_add_one=21 else - total_sub_one=20 - total=21 - total_add_one=22 + total_sub_one=21 + total=22 + total_add_one=23 fi echo "start scale in pump" diff --git a/tests/tiup-cluster/topo/full.yaml b/tests/tiup-cluster/topo/full.yaml index 603cfb3322..8d8345caf7 100644 --- a/tests/tiup-cluster/topo/full.yaml +++ b/tests/tiup-cluster/topo/full.yaml @@ -36,6 +36,9 @@ tiflash_servers: data_dir: "data1,/data/tiflash-data" # - host: n4 # - host: n5 +# +tiproxy_servers: + - host: n1 pump_servers: - host: n3 diff --git a/tests/tiup-cluster/topo/full_scale_in_tiproxy.yaml b/tests/tiup-cluster/topo/full_scale_in_tiproxy.yaml new file mode 100644 index 0000000000..628649b825 --- /dev/null +++ b/tests/tiup-cluster/topo/full_scale_in_tiproxy.yaml @@ -0,0 +1,2 @@ +tiproxy_servers: + - host: n2 diff --git a/tests/tiup-cluster/topo/full_tls.yaml b/tests/tiup-cluster/topo/full_tls.yaml index 72a7b57cf4..c7a7ded329 100644 --- a/tests/tiup-cluster/topo/full_tls.yaml +++ b/tests/tiup-cluster/topo/full_tls.yaml @@ -35,6 +35,9 @@ pump_servers: - host: n4 - host: n5 +tiproxy_servers: + - host: n1 + drainer_servers: - host: n1 data_dir: /home/tidb/data/drainer-8249/data diff --git a/tests/tiup-cluster/topo/full_without_tiflash.yaml b/tests/tiup-cluster/topo/full_without_tiflash.yaml index ead426014e..96d8efcafc 100644 --- a/tests/tiup-cluster/topo/full_without_tiflash.yaml +++ b/tests/tiup-cluster/topo/full_without_tiflash.yaml @@ -41,6 +41,9 @@ drainer_servers: config: syncer.db-type: "file" +tiproxy_servers: + - host: n1 + cdc_servers: - host: n3 - host: n4