Skip to content

Commit d36c2d4

Browse files
authored
Chore: Address Clickhouse Cloud test flakiness (#3782)
1 parent 0418cac commit d36c2d4

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.circleci/manage-test-db.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,16 @@ bigquery_init() {
9797
echo "$BIGQUERY_KEYFILE_CONTENTS" > $BIGQUERY_KEYFILE
9898
}
9999

100-
bigquery_up() {
101-
echo "BigQuery doesnt support creating databases"
102-
}
103100

104-
bigquery_down() {
105-
echo "BigQuery doesnt support dropping databases"
101+
# Clickhouse cloud
102+
clickhouse-cloud_init() {
103+
# note: the ping endpoint doesnt seem to need any API keys
104+
until curl https://$CLICKHOUSE_CLOUD_HOST:8443/ping
105+
do
106+
echo "Pinging Clickhouse Cloud service to ensure it's not in idle mode..."
107+
sleep 5
108+
done
109+
echo "Clickhouse Cloud instance $CLICKHOUSE_CLOUD_HOST is up and running"
106110
}
107111

108112
INIT_FUNC="${ENGINE}_init"
@@ -118,10 +122,10 @@ fi
118122
echo "Initializing $ENGINE"
119123
$INIT_FUNC
120124

121-
if [ "$DIRECTION" == "up" ]; then
125+
if [ "$DIRECTION" == "up" ] && function_exists $UP_FUNC; then
122126
echo "Creating database $DB_NAME"
123127
$UP_FUNC $DB_NAME
124-
elif [ "$DIRECTION" == "down" ]; then
128+
elif [ "$DIRECTION" == "down" ] && function_exists $DOWN_FUNC; then
125129
echo "Dropping database $DB_NAME"
126130
$DOWN_FUNC $DB_NAME
127131
fi

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ redshift-test: guard-REDSHIFT_HOST guard-REDSHIFT_USER guard-REDSHIFT_PASSWORD g
211211
pytest -n auto -x -m "redshift" --retries 3 --junitxml=test-results/junit-redshift.xml
212212

213213
clickhouse-cloud-test: guard-CLICKHOUSE_CLOUD_HOST guard-CLICKHOUSE_CLOUD_USERNAME guard-CLICKHOUSE_CLOUD_PASSWORD engine-clickhouse-install
214-
pytest -n auto -x -m "clickhouse_cloud" --retries 3 --junitxml=test-results/junit-clickhouse-cloud.xml
214+
pytest -n 1 -m "clickhouse_cloud" --retries 3 --junitxml=test-results/junit-clickhouse-cloud.xml
215215

216216
athena-test: guard-AWS_ACCESS_KEY_ID guard-AWS_SECRET_ACCESS_KEY guard-ATHENA_S3_WAREHOUSE_LOCATION engine-athena-install
217217
pytest -n auto -x -m "athena" --retries 3 --retry-delay 10 --junitxml=test-results/junit-athena.xml

tests/core/engine_adapter/integration/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ gateways:
149149
port: 8443
150150
username: {{ env_var("CLICKHOUSE_CLOUD_USERNAME") }}
151151
password: {{ env_var("CLICKHOUSE_CLOUD_PASSWORD") }}
152+
connect_timeout: 30
153+
connection_pool_options:
154+
retries: 5
152155
state_connection:
153156
type: duckdb
154157

0 commit comments

Comments
 (0)