diff --git a/tests/_utils/shardddl_lib.sh b/tests/_utils/shardddl_lib.sh index 9c0733d669..39bcacc7c8 100644 --- a/tests/_utils/shardddl_lib.sh +++ b/tests/_utils/shardddl_lib.sh @@ -47,8 +47,9 @@ function clean_table() { function restart_master() { echo "restart dm-master" - wait_process_exit dm-master.test + ps aux | grep dm-master | awk '{print $2}' | xargs kill || true check_port_offline $MASTER_PORT 20 + sleep 2 run_dm_master $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT diff --git a/tests/_utils/wait_process_exit b/tests/_utils/wait_process_exit index 3530e8020f..b3b6fa75e0 100755 --- a/tests/_utils/wait_process_exit +++ b/tests/_utils/wait_process_exit @@ -1,29 +1,20 @@ #!/bin/bash # parameter 1: process name -process=$1 - -PID=$(pgrep $process) -if [ -z "$PID" ]; then - echo "process $process already exit" - exit -fi -WAIT_COUNT=10 -KILL_TIMES=1 # make sure only send kill -9 once. -count=0 +process=$1 -while true; do +WAIT_COUNT=0 +while [ $WAIT_COUNT -lt 30 ]; do pgrep $process >/dev/null 2>&1 ret=$? if [ "$ret" != "0" ]; then echo "process $process already exit" - break + exit 0 fi - sleep 0.2 - ((count++)) + sleep 1 echo "wait process $process exit..." - if [ $count -gt $WAIT_COUNT ] && [ $KILL_TIMES -lt 2 ]; then - ((KILL_TIMES++)) - kill -9 $PID || true - fi + ((WAIT_COUNT++)) done + +echo "process $process didn't exit after 30 seconds" +exit 1 diff --git a/tests/tiup/lib.sh b/tests/tiup/lib.sh index 082fa2b17e..ad9eb4134b 100755 --- a/tests/tiup/lib.sh +++ b/tests/tiup/lib.sh @@ -59,8 +59,8 @@ function exec_full_stage() { exec_sql mariadb2 3306 "INSERT INTO $DB2.$TBL3 (c1, c2) VALUES (12, '12');" # prepare optimsitic full data - exec_sql mysql1 3306 "CREATE DATABASE $DB3;" - exec_sql mariadb2 3306 "CREATE DATABASE $DB4;" + exec_sql mysql1 3306 "CREATE DATABASE $DB3 CHARACTER SET UTF8MB4 COLLATE utf8mb4_bin;" + exec_sql mariadb2 3306 "CREATE DATABASE $DB4 CHARACTER SET UTF8MB4 COLLATE utf8mb4_bin;" exec_sql mysql1 3306 "CREATE TABLE $DB3.$TBL1 (c1 INT PRIMARY KEY, c2 TEXT);" exec_sql mysql1 3306 "CREATE TABLE $DB3.$TBL2 (c1 INT PRIMARY KEY, c2 TEXT);" exec_sql mariadb2 3306 "CREATE TABLE $DB4.$TBL2 (c1 INT PRIMARY KEY, c2 TEXT);"