From b434021c8bcc4255bfbe6bcd92e0413fcec3e79d Mon Sep 17 00:00:00 2001 From: lance6716 Date: Tue, 15 Jun 2021 14:07:48 +0800 Subject: [PATCH 01/10] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 57ea4279c0..47e7033cfd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +enable PR + # TiDB Data Migration Platform [![Build Status](https://internal.pingcap.net/idc-jenkins/job/build_dm_multi_branch/job/master/badge/icon)](https://internal.pingcap.net/idc-jenkins/job/build_dm_multi_branch/job/master) From 6af0d008420b39bcec0e04114a73bfc32d5cb5ea Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 18 Jun 2021 17:11:54 +0800 Subject: [PATCH 02/10] revert a suspicious change --- README.md | 2 -- tests/_utils/wait_process_exit | 35 +++++++++++----------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 47e7033cfd..57ea4279c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -enable PR - # TiDB Data Migration Platform [![Build Status](https://internal.pingcap.net/idc-jenkins/job/build_dm_multi_branch/job/master/badge/icon)](https://internal.pingcap.net/idc-jenkins/job/build_dm_multi_branch/job/master) diff --git a/tests/_utils/wait_process_exit b/tests/_utils/wait_process_exit index 3530e8020f..1b300fbd08 100755 --- a/tests/_utils/wait_process_exit +++ b/tests/_utils/wait_process_exit @@ -1,29 +1,16 @@ #!/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 - pgrep $process >/dev/null 2>&1 - ret=$? - if [ "$ret" != "0" ]; then - echo "process $process already exit" - break - fi - sleep 0.2 - ((count++)) - echo "wait process $process exit..." - if [ $count -gt $WAIT_COUNT ] && [ $KILL_TIMES -lt 2 ]; then - ((KILL_TIMES++)) - kill -9 $PID || true - fi +while true +do + pgrep $process > /dev/null 2>&1 + ret=$? + if [ "$ret" != "0" ]; then + echo "process $process already exit" + break + fi + sleep 0.2 + echo "wait process $process exit..." done From 159084e4e24279f00b85fb363ab75538d3850015 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 18 Jun 2021 22:16:38 +0800 Subject: [PATCH 03/10] revert lost kill --- tests/_utils/shardddl_lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/_utils/shardddl_lib.sh b/tests/_utils/shardddl_lib.sh index 9c0733d669..29dbfb3c9e 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 + kill_dm_master 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 From 642281f1dcb4583e71fa3f03d94c119dab273161 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Sat, 19 Jun 2021 17:49:25 +0800 Subject: [PATCH 04/10] add sleep to debug --- tests/run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/run.sh b/tests/run.sh index 4ac65ace00..3cee4b5345 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eu +set -euE TEST_DIR=/tmp/dm_test CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) @@ -80,6 +80,12 @@ if [ $should_run -eq 0 ]; then fi trap stop_services EXIT +sleep_for_debug() { + echo "debug now" + sleep 1200 +} +trap sleep_for_debug ERR + start_services function run() { From 613b4137d14dcfea3de006655a8bb953e6c70bbc Mon Sep 17 00:00:00 2001 From: lance6716 Date: Sat, 19 Jun 2021 20:29:56 +0800 Subject: [PATCH 05/10] try revert a change --- tests/_utils/shardddl_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_utils/shardddl_lib.sh b/tests/_utils/shardddl_lib.sh index 29dbfb3c9e..39bcacc7c8 100644 --- a/tests/_utils/shardddl_lib.sh +++ b/tests/_utils/shardddl_lib.sh @@ -47,7 +47,7 @@ function clean_table() { function restart_master() { echo "restart dm-master" - kill_dm_master + ps aux | grep dm-master | awk '{print $2}' | xargs kill || true check_port_offline $MASTER_PORT 20 sleep 2 From 90fa90e3d456345d4a782c0d50b450a3590af980 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Mon, 21 Jun 2021 10:57:53 +0800 Subject: [PATCH 06/10] address comment --- tests/_utils/wait_process_exit | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/_utils/wait_process_exit b/tests/_utils/wait_process_exit index 1b300fbd08..95d138bf86 100755 --- a/tests/_utils/wait_process_exit +++ b/tests/_utils/wait_process_exit @@ -3,14 +3,18 @@ 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 + sleep 1 echo "wait process $process exit..." + ((WAIT_COUNT++)) done + +echo "process $process didn't exit after 30 seconds" +exit 1 \ No newline at end of file From 88ac1595f6ec3d30ada0d434e5f4bafab784b516 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Mon, 21 Jun 2021 10:59:27 +0800 Subject: [PATCH 07/10] format --- tests/_utils/wait_process_exit | 20 ++++++++++---------- tests/run.sh | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/_utils/wait_process_exit b/tests/_utils/wait_process_exit index 95d138bf86..b3b6fa75e0 100755 --- a/tests/_utils/wait_process_exit +++ b/tests/_utils/wait_process_exit @@ -5,16 +5,16 @@ process=$1 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" - exit 0 - fi - sleep 1 - echo "wait process $process exit..." - ((WAIT_COUNT++)) + pgrep $process >/dev/null 2>&1 + ret=$? + if [ "$ret" != "0" ]; then + echo "process $process already exit" + exit 0 + fi + sleep 1 + echo "wait process $process exit..." + ((WAIT_COUNT++)) done echo "process $process didn't exit after 30 seconds" -exit 1 \ No newline at end of file +exit 1 diff --git a/tests/run.sh b/tests/run.sh index 3cee4b5345..dee028520e 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -81,8 +81,8 @@ fi trap stop_services EXIT sleep_for_debug() { - echo "debug now" - sleep 1200 + echo "debug now" + sleep 1200 } trap sleep_for_debug ERR From 380a16a33855f7d48bcbabef6fa06190223ab4ee Mon Sep 17 00:00:00 2001 From: lance6716 Date: Mon, 21 Jun 2021 17:44:46 +0800 Subject: [PATCH 08/10] Update run.sh --- tests/run.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/run.sh b/tests/run.sh index dee028520e..7b690065b9 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -euE +set -eu TEST_DIR=/tmp/dm_test CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) @@ -80,11 +80,6 @@ if [ $should_run -eq 0 ]; then fi trap stop_services EXIT -sleep_for_debug() { - echo "debug now" - sleep 1200 -} -trap sleep_for_debug ERR start_services From 62a08b4c920fe2b5dd47954ca507825d04eb1035 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Mon, 21 Jun 2021 17:45:04 +0800 Subject: [PATCH 09/10] Update run.sh --- tests/run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/run.sh b/tests/run.sh index 7b690065b9..4ac65ace00 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -80,7 +80,6 @@ if [ $should_run -eq 0 ]; then fi trap stop_services EXIT - start_services function run() { From 6895cabac3e85ca4fba024f3736ce37f16b9e60a Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Tue, 22 Jun 2021 10:53:50 +0800 Subject: [PATCH 10/10] fix upgrade ci --- tests/tiup/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);"