mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #48674 from CheSema/more_logs_47882
show result of minio listings for test test_attach_detach_partition
This commit is contained in:
commit
3ada33db56
@ -101,6 +101,13 @@ def run_s3_mocks(cluster):
|
||||
)
|
||||
|
||||
|
||||
def list_objects(cluster, path="data/"):
|
||||
minio = cluster.minio_client
|
||||
objects = list(minio.list_objects(cluster.minio_bucket, path, recursive=True))
|
||||
logging.info(f"list_objects ({len(objects)}): {[x.object_name for x in objects]}")
|
||||
return objects
|
||||
|
||||
|
||||
def wait_for_delete_s3_objects(cluster, expected, timeout=30):
|
||||
minio = cluster.minio_client
|
||||
while timeout > 0:
|
||||
@ -130,9 +137,7 @@ def drop_table(cluster, node_name):
|
||||
wait_for_delete_s3_objects(cluster, 0)
|
||||
finally:
|
||||
# Remove extra objects to prevent tests cascade failing
|
||||
for obj in list(
|
||||
minio.list_objects(cluster.minio_bucket, "data/", recursive=True)
|
||||
):
|
||||
for obj in list_objects(cluster, "data/"):
|
||||
minio.remove_object(cluster.minio_bucket, obj.object_name)
|
||||
|
||||
|
||||
@ -297,7 +302,7 @@ def test_attach_detach_partition(cluster, node_name):
|
||||
)
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(8192)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/", recursive=True)))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 2
|
||||
)
|
||||
|
||||
@ -306,14 +311,14 @@ def test_attach_detach_partition(cluster, node_name):
|
||||
wait_for_delete_inactive_parts(node, "s3_test")
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(4096)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/", recursive=True)))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 2
|
||||
)
|
||||
|
||||
node.query("ALTER TABLE s3_test ATTACH PARTITION '2020-01-03'")
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(8192)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/", recursive=True)))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 2
|
||||
)
|
||||
|
||||
@ -322,7 +327,7 @@ def test_attach_detach_partition(cluster, node_name):
|
||||
wait_for_delete_inactive_parts(node, "s3_test")
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(4096)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/", recursive=True)))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 1
|
||||
)
|
||||
|
||||
@ -331,7 +336,7 @@ def test_attach_detach_partition(cluster, node_name):
|
||||
wait_for_delete_inactive_parts(node, "s3_test")
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(0)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/")))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 1
|
||||
)
|
||||
node.query(
|
||||
@ -340,7 +345,7 @@ def test_attach_detach_partition(cluster, node_name):
|
||||
)
|
||||
assert node.query("SELECT count(*) FROM s3_test FORMAT Values") == "(0)"
|
||||
assert (
|
||||
len(list(minio.list_objects(cluster.minio_bucket, "data/", recursive=True)))
|
||||
len(list_objects(cluster, "data/"))
|
||||
== FILES_OVERHEAD + FILES_OVERHEAD_PER_PART_WIDE * 0
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user