diff --git a/tests/integration/test_azure_blob_storage_zero_copy_replication/test.py b/tests/integration/test_azure_blob_storage_zero_copy_replication/test.py index 08fb6e53e7b..ead5ab7f18e 100644 --- a/tests/integration/test_azure_blob_storage_zero_copy_replication/test.py +++ b/tests/integration/test_azure_blob_storage_zero_copy_replication/test.py @@ -12,6 +12,7 @@ TABLE_NAME = "blob_storage_table" CONTAINER_NAME = "cont" CLUSTER_NAME = "test_cluster" +drop_table_statement = f"DROP TABLE {TABLE_NAME} ON CLUSTER {CLUSTER_NAME} SYNC" @pytest.fixture(scope="module") def cluster(): @@ -47,11 +48,9 @@ def create_table(node, table_name, replica, **additional_settings): ORDER BY id SETTINGS {",".join((k+"="+repr(v) for k, v in settings.items()))}""" - node.query(f"DROP TABLE IF EXISTS {table_name}") node.query(create_table_statement) assert node.query(f"SELECT COUNT(*) FROM {table_name} FORMAT Values") == "(0)" - def get_large_objects_count(blob_container_client, large_size_threshold=100): return sum(blob['size'] > large_size_threshold for blob in blob_container_client.list_blobs()) @@ -81,3 +80,4 @@ def test_zero_copy_replication(cluster): assert node1.query(f"SELECT * FROM {TABLE_NAME} order by id FORMAT Values") == values1 + "," + values2 assert get_large_objects_count(blob_container_client) == 2 + node1.query(drop_table_statement) diff --git a/tests/integration/test_backup_with_other_granularity/test.py b/tests/integration/test_backup_with_other_granularity/test.py index 0f35c0f849e..de61bfdb1d8 100644 --- a/tests/integration/test_backup_with_other_granularity/test.py +++ b/tests/integration/test_backup_with_other_granularity/test.py @@ -60,6 +60,9 @@ def test_backup_from_old_version(started_cluster): assert node1.query("CHECK TABLE dest_table") == "1\n" + node1.query("DROP TABLE source_table") + node1.query("DROP TABLE dest_table") + def test_backup_from_old_version_setting(started_cluster): node2.query("CREATE TABLE source_table(A Int64, B String) Engine = MergeTree order by tuple()") @@ -97,6 +100,9 @@ def test_backup_from_old_version_setting(started_cluster): assert node2.query("CHECK TABLE dest_table") == "1\n" + node2.query("DROP TABLE source_table") + node2.query("DROP TABLE dest_table") + def test_backup_from_old_version_config(started_cluster): node3.query("CREATE TABLE source_table(A Int64, B String) Engine = MergeTree order by tuple()") @@ -138,6 +144,8 @@ def test_backup_from_old_version_config(started_cluster): assert node3.query("CHECK TABLE dest_table") == "1\n" + node3.query("DROP TABLE source_table") + node3.query("DROP TABLE dest_table") def test_backup_and_alter(started_cluster): node4.query("CREATE DATABASE test ENGINE=Ordinary") # Different path in shadow/ with Atomic @@ -160,3 +168,6 @@ def test_backup_and_alter(started_cluster): assert node4.query("SELECT sum(A) FROM test.backup_table") == "2\n" assert node4.query("SELECT B + 2 FROM test.backup_table") == "4\n" + + node4.query("DROP TABLE test.backup_table") + node4.query("DROP DATABASE test")