Skip to content

Commit 8593df9

Browse files
committed
Increase startup timeout for TiDB 6.1.x and 6.5.x versions
Older TiDB versions (6.1.x and 6.5.x) require more time to start up than newer versions. Increase timeout from 120 seconds to 240 seconds (4 minutes) for these versions to prevent false test failures. Newer versions (7.x and 8.x) continue to use 120 seconds timeout.
1 parent 9cfa9ac commit 8593df9

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/tidb-playground.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,18 @@ if [ "$MODE" = "start" ]; then
4444
PLAYGROUND_PID=$!
4545
echo $PLAYGROUND_PID > /tmp/tidb-playground-${PORT}.pid
4646

47-
# Wait for TiDB to be ready (max 120 seconds)
48-
echo "Waiting for TiDB to be ready..."
49-
for i in {1..120}; do
47+
# Determine timeout based on TiDB version
48+
# Versions 6.1.x and 6.5.x need longer startup time
49+
if [[ "${VERSION}" == 6.1.* ]] || [[ "${VERSION}" == 6.5.* ]]; then
50+
TIMEOUT=240 # 4 minutes for older versions
51+
echo "Using extended timeout (240s) for TiDB ${VERSION}"
52+
else
53+
TIMEOUT=120 # 2 minutes for newer versions
54+
fi
55+
56+
# Wait for TiDB to be ready
57+
echo "Waiting for TiDB to be ready (max ${TIMEOUT} seconds)..."
58+
for i in $(seq 1 ${TIMEOUT}); do
5059
if mysql -h 127.0.0.1 -P ${PORT} -u root -e 'SELECT 1' >/dev/null 2>&1; then
5160
echo "TiDB is ready!"
5261
exit 0
@@ -58,7 +67,7 @@ if [ "$MODE" = "start" ]; then
5867
done
5968

6069
echo ""
61-
echo "ERROR: TiDB failed to start within 120 seconds"
70+
echo "ERROR: TiDB failed to start within ${TIMEOUT} seconds"
6271
echo "Last 20 lines of playground log:"
6372
tail -20 /tmp/tidb-playground-${PORT}.log || true
6473
exit 1

0 commit comments

Comments
 (0)