Skip to content

Commit

Permalink
Merge pull request ClickHouse#63720 from Avogar/better-s3-seekable-fo…
Browse files Browse the repository at this point in the history
…rmats-tests

Try to fix flaky s3 tests test_seekable_formats and test_seekable_formats_url
  • Loading branch information
Avogar authored Jun 12, 2024
2 parents 410f0b6 + 61a6a27 commit 9c7c607
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/integration/helpers/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,18 @@ def assert_logs_contain_with_retry(instance, substring, retry_count=20, sleep_ti


def exec_query_with_retry(
instance, query, retry_count=40, sleep_time=0.5, silent=False, settings={}
instance,
query,
retry_count=40,
sleep_time=0.5,
silent=False,
settings={},
timeout=30,
):
exception = None
for cnt in range(retry_count):
try:
res = instance.query(query, timeout=30, settings=settings)
res = instance.query(query, timeout=timeout, settings=settings)
if not silent:
logging.debug(f"Result of {query} on {cnt} try is {res}")
break
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_storage_s3/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ def test_seekable_formats(started_cluster):
exec_query_with_retry(
instance,
f"insert into table function {table_function} SELECT number, randomString(100) FROM numbers(1000000) settings s3_truncate_on_insert=1",
timeout=100,
)

result = instance.query(f"SELECT count() FROM {table_function}")
Expand All @@ -1142,6 +1143,7 @@ def test_seekable_formats(started_cluster):
exec_query_with_retry(
instance,
f"insert into table function {table_function} SELECT number, randomString(100) FROM numbers(1500000) settings s3_truncate_on_insert=1",
timeout=100,
)

result = instance.query(
Expand Down Expand Up @@ -1169,6 +1171,7 @@ def test_seekable_formats_url(started_cluster):
exec_query_with_retry(
instance,
f"insert into table function {table_function} SELECT number, randomString(100) FROM numbers(1500000) settings s3_truncate_on_insert=1",
timeout=100,
)

result = instance.query(f"SELECT count() FROM {table_function}")
Expand All @@ -1178,6 +1181,7 @@ def test_seekable_formats_url(started_cluster):
exec_query_with_retry(
instance,
f"insert into table function {table_function} SELECT number, randomString(100) FROM numbers(1500000) settings s3_truncate_on_insert=1",
timeout=100,
)

table_function = f"url('http://{started_cluster.minio_host}:{started_cluster.minio_port}/{bucket}/test_parquet', 'Parquet', 'a Int32, b String')"
Expand Down

0 comments on commit 9c7c607

Please sign in to comment.