Skip to content

Commit

Permalink
cluster: add integration tests for tiproxy (#2371)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Jan 29, 2024
1 parent 5811bbb commit 271d5ea
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
18 changes: 16 additions & 2 deletions tests/tiup-cluster/script/scale_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/tiup-cluster/script/scale_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests/tiup-cluster/topo/full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ tiflash_servers:
data_dir: "data1,/data/tiflash-data"
# - host: n4
# - host: n5
#
tiproxy_servers:
- host: n1

pump_servers:
- host: n3
Expand Down
2 changes: 2 additions & 0 deletions tests/tiup-cluster/topo/full_scale_in_tiproxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tiproxy_servers:
- host: n2
3 changes: 3 additions & 0 deletions tests/tiup-cluster/topo/full_tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/tiup-cluster/topo/full_without_tiflash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ drainer_servers:
config:
syncer.db-type: "file"

tiproxy_servers:
- host: n1

cdc_servers:
- host: n3
- host: n4
Expand Down

0 comments on commit 271d5ea

Please sign in to comment.