diff --git a/tests/integration/test_s3_plain_rewritable/configs/storage_conf.xml b/tests/integration/test_s3_plain_rewritable/configs/storage_conf.xml
index 560e6b6eca4..23368394494 100644
--- a/tests/integration/test_s3_plain_rewritable/configs/storage_conf.xml
+++ b/tests/integration/test_s3_plain_rewritable/configs/storage_conf.xml
@@ -8,6 +8,13 @@
minio
minio123
+
+ cache
+ disk_s3_plain_rewritable
+ /var/lib/clickhouse/disks/s3_plain_rewritable_cache/
+ 1000000000
+ 1
+
@@ -17,6 +24,13 @@
+
+
+
+ disk_cache_s3_plain_rewritable
+
+
+
diff --git a/tests/integration/test_s3_plain_rewritable/test.py b/tests/integration/test_s3_plain_rewritable/test.py
index 06967958631..4b1aaafc814 100644
--- a/tests/integration/test_s3_plain_rewritable/test.py
+++ b/tests/integration/test_s3_plain_rewritable/test.py
@@ -8,11 +8,8 @@ from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
NUM_WORKERS = 5
-
MAX_ROWS = 1000
-dirs_created = []
-
def gen_insert_values(size):
return ",".join(
@@ -46,8 +43,14 @@ def start_cluster():
cluster.shutdown()
-@pytest.mark.order(0)
-def test_insert():
+@pytest.mark.parametrize(
+ "storage_policy",
+ [
+ pytest.param("s3_plain_rewritable"),
+ pytest.param("cache_s3_plain_rewritable"),
+ ],
+)
+def test(storage_policy):
def create_insert(node, insert_values):
node.query(
"""
@@ -56,8 +59,10 @@ def test_insert():
data String
) ENGINE=MergeTree()
ORDER BY id
- SETTINGS storage_policy='s3_plain_rewritable'
- """
+ SETTINGS storage_policy='{}'
+ """.format(
+ storage_policy
+ )
)
node.query("INSERT INTO test VALUES {}".format(insert_values))
@@ -107,25 +112,6 @@ def test_insert():
!= -1
)
- created = int(
- node.query(
- "SELECT value FROM system.events WHERE event = 'DiskPlainRewritableS3DirectoryCreated'"
- )
- )
- assert created > 0
- dirs_created.append(created)
- assert (
- int(
- node.query(
- "SELECT value FROM system.metrics WHERE metric = 'DiskPlainRewritableS3DirectoryMapSize'"
- )
- )
- == created
- )
-
-
-@pytest.mark.order(1)
-def test_restart():
insert_values_arr = []
for i in range(NUM_WORKERS):
node = cluster.instances[f"node{i + 1}"]
@@ -138,6 +124,7 @@ def test_restart():
threads = []
for i in range(NUM_WORKERS):
+ node = cluster.instances[f"node{i + 1}"]
t = threading.Thread(target=restart, args=(node,))
threads.append(t)
t.start()
@@ -152,21 +139,10 @@ def test_restart():
== insert_values_arr[i]
)
-
-@pytest.mark.order(2)
-def test_drop():
for i in range(NUM_WORKERS):
node = cluster.instances[f"node{i + 1}"]
node.query("DROP TABLE IF EXISTS test SYNC")
- removed = int(
- node.query(
- "SELECT value FROM system.events WHERE event = 'DiskPlainRewritableS3DirectoryRemoved'"
- )
- )
-
- assert dirs_created[i] == removed
-
it = cluster.minio_client.list_objects(
cluster.minio_bucket, "data/", recursive=True
)