mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
4 new test directories (generic settings-profile constraints, table data-drop size guards, startup-script dictionary creation, and Delta Lake concurrent shuffle reads) plus AWS STS assume-role coverage added to the existing test_storage_delta and test_storage_s3_queue suites, ported from ClickHouse's private/Cloud fork. None of these depend on SharedMergeTree, Shared Catalog, or any other Cloud-only feature. test_storage_s3_queue/test_sts_smoke.py needed a small, generic extension to the create_table() helper in helpers/s3_queue_common.py to pass through an extra_credentials() clause and support schema-less CREATE TABLE (empty format string) - matches the private fork's helper exactly. Every test here was run against a real local build via `python -m ci.praktika run "integration" --test ...` and confirmed passing before being added. A larger initial candidate list (17 directories, including test_packed_io, test_cache_warmer, test_prewarm_cache_merges, and additions to test_check_table, test_database_glue, test_default_compression_codec, test_replicated_database, and test_s3_cluster) was pared down after actually running them surfaced either Cloud-only dependencies invisible to code review, or real unexplained behavioral differences (S3 request counts, CHECK TABLE corruption detection on packed parts, a disks-CLI packed-io command mismatch) that need further investigation before they can be safely ported. Co-Authored-By: Claude Sonnet 5 <[email protected]>
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
import pytest
|
|
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
cluster = ClickHouseCluster(__file__)
|
|
node = cluster.add_instance("node", main_configs=["configs/config_information.xml"])
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def start_cluster():
|
|
try:
|
|
cluster.start()
|
|
yield cluster
|
|
finally:
|
|
cluster.shutdown()
|
|
|
|
|
|
def test_check_can_drop_partition_and_table(start_cluster):
|
|
node.query(
|
|
"DROP TABLE IF EXISTS test_drop SYNC SETTINGS max_table_size_to_drop=12345678;"
|
|
)
|
|
node.query("CREATE TABLE test_drop (a UInt64) ENGINE=MergeTree() ORDER BY tuple();")
|
|
node.query("INSERT INTO test_drop SELECT * FROM system.numbers_mt LIMIT 1000000;")
|
|
node.query("OPTIMIZE TABLE test_drop FINAL;")
|
|
|
|
assert "was not dropped" in node.query_and_get_error(
|
|
"ALTER TABLE test_drop DROP PARTITION ID 'all';"
|
|
)
|
|
node.query(
|
|
"ALTER TABLE test_drop DROP PARTITION ID 'all' SETTINGS max_partition_size_to_drop=12345678;"
|
|
)
|
|
|
|
node.query("INSERT INTO test_drop SELECT * FROM system.numbers_mt LIMIT 100000;")
|
|
|
|
assert "was not dropped" in node.query_and_get_error("DROP TABLE test_drop SYNC;")
|
|
node.query("DROP TABLE test_drop SYNC SETTINGS max_table_size_to_drop=12345678;")
|