From 5d1b29a87aa07a0b12e4f5eac2308ab0662079b6 Mon Sep 17 00:00:00 2001 From: jujiajia Date: Sat, 18 Sep 2021 13:42:27 +0800 Subject: [PATCH] integration test: fix invalid pgrep expression which may cause case fail sometime; add sleep to all_mode test(may fail sometimes) --- tests/_utils/test_prepare | 2 +- tests/all_mode/run.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/_utils/test_prepare b/tests/_utils/test_prepare index dce628e9d4..c64c92f8ac 100644 --- a/tests/_utils/test_prepare +++ b/tests/_utils/test_prepare @@ -32,7 +32,7 @@ function wait_pattern_exit() { pattern=$1 while true do - if [ "pgrep -f $pattern" != "0" ]; then + if ! pgrep -f $pattern >/dev/null 2>&1; then echo "pattern $pattern already exit" return 0 fi diff --git a/tests/all_mode/run.sh b/tests/all_mode/run.sh index b78455bf64..f74fb2576a 100755 --- a/tests/all_mode/run.sh +++ b/tests/all_mode/run.sh @@ -400,6 +400,7 @@ function run() { "resume-relay -s mysql-replica-01" \ "\"result\": true" 2 + sleep 2 # relay should continue pulling from syncer's checkpoint, so only pull the latest binlog server_uuid=$(tail -n 1 $WORK_DIR/worker1/relay_log/server-uuid.index) echo "relay logs $(ls $WORK_DIR/worker1/relay_log/$server_uuid)"