From d3245357d08da71fe897ab18d05dd18f15ca6978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=B2=9A?= <36239017+YuJuncen@users.noreply.github.com> Date: Fri, 1 Apr 2022 13:14:29 +0800 Subject: [PATCH] br: fix unstable s3 test (#33610) close pingcap/tidb#33644 --- br/tests/br_s3/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/br/tests/br_s3/run.sh b/br/tests/br_s3/run.sh index 9cd383de4f..7aa2349f4f 100755 --- a/br/tests/br_s3/run.sh +++ b/br/tests/br_s3/run.sh @@ -37,13 +37,15 @@ start_s3() { bin/minio server --address $S3_ENDPOINT "$TEST_DIR/$DB" & s3_pid=$! i=0 - while ! curl -o /dev/null -v -s "http://$S3_ENDPOINT/"; do + status="$(curl -o /dev/null -v -s "http://$S3_ENDPOINT/" -w '%{http_code}' || true)" + while ! [ "$status" -gt 0 ] && [ "$status" -lt 500 ]; do i=$(($i+1)) if [ $i -gt 30 ]; then echo 'Failed to start minio' exit 1 fi sleep 2 + status="$(curl -o /dev/null -v -s "http://$S3_ENDPOINT/" -w '%{http_code}' || true)" done }