br: fix unstable s3 test (#33610)

close pingcap/tidb#33644
This commit is contained in:
山岚
2022-04-01 13:14:29 +08:00
committed by GitHub
parent 94c57b3049
commit d3245357d0

View File

@ -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
}