Skip to content

Commit f09cf89

Browse files
Merge pull request ClickHouse#79843 from ClickHouse/ncb/fix-glue-flaky
try to fix flaky test test_database_glue
2 parents 78c5eb8 + 789ca07 commit f09cf89

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

tests/integration/compose/docker_compose_glue_catalog.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ services:
1414
start_period: 30s
1515
minio:
1616
image: minio/minio
17-
container_name: minio
1817
environment:
1918
- MINIO_ROOT_USER=minio
2019
- MINIO_ROOT_PASSWORD=minio123

tests/integration/compose/docker_compose_iceberg_hms_catalog.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ services:
3535

3636
minio:
3737
image: minio/minio
38-
container_name: minio
3938
environment:
4039
- MINIO_ROOT_USER=minio
4140
- MINIO_ROOT_PASSWORD=minio123

tests/integration/compose/docker_compose_iceberg_rest_catalog.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ services:
3535
start_period: 30s
3636
minio:
3737
image: minio/minio
38-
container_name: minio
3938
environment:
4039
- MINIO_ROOT_USER=minio
4140
- MINIO_ROOT_PASSWORD=ClickHouse_Minio_P@ssw0rd

tests/integration/test_database_glue/test.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
#!/usr/bin/env python3
2-
import glob
3-
import json
41
import logging
52
import os
63
import random
7-
import time
84
import uuid
9-
from datetime import datetime, timedelta
5+
from datetime import datetime
106

117
import pyarrow as pa
128
import pytest
13-
import requests
149
import urllib3
1510
from minio import Minio
1611
from pyiceberg.catalog import load_catalog
@@ -28,8 +23,6 @@
2823
)
2924

3025
from helpers.cluster import ClickHouseCluster, ClickHouseInstance, is_arm
31-
from helpers.s3_tools import get_file_contents, list_s3_objects, prepare_s3_bucket
32-
from helpers.test_tools import TSV, csv_compare
3326

3427
import boto3
3528

@@ -72,22 +65,26 @@
7265

7366

7467
def list_databases():
75-
client = boto3.client("glue", region_name="us-east-1", endpoint_url=BASE_URL_LOCAL_HOST)
68+
client = boto3.client(
69+
"glue", region_name="us-east-1", endpoint_url=BASE_URL_LOCAL_HOST
70+
)
7671
databases = client.get_databases()
7772
return databases
7873

7974

8075
def load_catalog_impl(started_cluster):
8176
return load_catalog(
82-
CATALOG_NAME, # name is not important
77+
CATALOG_NAME, # name is not important
8378
**{
8479
"type": "glue",
8580
"glue.endpoint": BASE_URL_LOCAL_HOST,
8681
"glue.region": "us-east-1",
8782
"s3.endpoint": "http://localhost:9002",
8883
"s3.access-key-id": "minio",
8984
"s3.secret-access-key": "minio123",
90-
},)
85+
},
86+
)
87+
9188

9289
def create_table(
9390
catalog,
@@ -227,13 +224,12 @@ def test_list_tables(started_cluster):
227224

228225
expected = DEFAULT_CREATE_TABLE.format(CATALOG_NAME, namespace_2, "tableC")
229226
print("Expected", expected)
230-
print("Got", node.query(
231-
f"SHOW CREATE TABLE {CATALOG_NAME}.`{namespace_2}.tableC`"
232-
))
227+
print("Got", node.query(f"SHOW CREATE TABLE {CATALOG_NAME}.`{namespace_2}.tableC`"))
233228
assert expected == node.query(
234229
f"SHOW CREATE TABLE {CATALOG_NAME}.`{namespace_2}.tableC`"
235230
)
236231

232+
237233
def test_select(started_cluster):
238234
node = started_cluster.instances["node1"]
239235

@@ -285,13 +281,16 @@ def test_hide_sensitive_info(started_cluster):
285281
catalog = load_catalog_impl(started_cluster)
286282
catalog.create_namespace(namespace)
287283

288-
table = create_table(catalog, namespace, table_name)
284+
create_table(catalog, namespace, table_name)
289285

290286
create_clickhouse_glue_database(
291287
started_cluster,
292288
node,
293289
CATALOG_NAME,
294-
additional_settings={"aws_access_key_id": "SECRET_1", "aws_secret_access_key": "SECRET_2"},
290+
additional_settings={
291+
"aws_access_key_id": "SECRET_1",
292+
"aws_secret_access_key": "SECRET_2",
293+
},
295294
)
296295
assert "SECRET_1" not in node.query(f"SHOW CREATE DATABASE {CATALOG_NAME}")
297296
assert "SECRET_2" not in node.query(f"SHOW CREATE DATABASE {CATALOG_NAME}")

0 commit comments

Comments
 (0)