Skip to content

Commit c05885e

Browse files
authored
Wake up ClickHouse Cloud instance before tests (#429)
1 parent 84b5d73 commit c05885e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/cloud.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ jobs:
4444
distribution: zulu
4545
java-version: 8
4646
cache: gradle
47+
- name: Wake up ClickHouse Cloud instance
48+
env:
49+
CLICKHOUSE_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
50+
run: |
51+
echo "Waking up ClickHouse Cloud instance..."
52+
max_attempts=3
53+
attempt=1
54+
55+
while [ $attempt -le $max_attempts ]; do
56+
echo "Attempt $attempt of $max_attempts"
57+
if curl -sS "https://${CLICKHOUSE_CLOUD_HOST}:8443/?query=SELECT+1" \
58+
--user "default:${CLICKHOUSE_PASSWORD}" \
59+
--max-time 60 > /dev/null; then
60+
echo "Instance is awake!"
61+
break
62+
else
63+
if [ $attempt -eq $max_attempts ]; then
64+
echo "Failed to wake instance after $max_attempts attempts"
65+
exit 1
66+
fi
67+
echo "Retrying in 10 seconds..."
68+
sleep 10
69+
((attempt++))
70+
fi
71+
done
4772
- run: >-
4873
./gradlew clean cloudTest --no-daemon --refresh-dependencies
4974
-Dspark_binary_version=${{ matrix.spark }}

0 commit comments

Comments
 (0)