Files
Alexey MilovidovandClaude Opus 4.6 f9ec529e4f Fix MSan integration test failures: guard deltaLakeAzureCluster with USE_DELTA_KERNEL_RS and skip flaky tests
The `deltaLakeAzureCluster` table function was registered under `#if USE_AZURE_BLOB_STORAGE`
but the corresponding `DeltaLakeAzure` storage engine requires `USE_DELTA_KERNEL_RS`. This
mismatch caused a `LOGICAL_ERROR` exception when the table function tried to look up its
engine for access checking, crashing the server in debug builds.

Fixes:
- Add `USE_DELTA_KERNEL_RS` guard to `deltaLakeAzureCluster` registration (.cpp, .h, template)
- Change `getSourceAccessObject` from `LOGICAL_ERROR` to `UNKNOWN_STORAGE` for unknown engines
- Fix copy-paste in documentation: "Iceberg" → "DeltaLake" for `deltaLakeAzureCluster`
- Skip Delta Lake tests when `DeltaLake` engine is not available (query `system.table_engines`)
- Conditionally handle Delta Lake entries in `test_mask_sensitive_info` based on engine availability
- Skip timing-sensitive and memory-measurement tests under MSan:
  `test_ttl_compatibility`, `test_memory_limit_success`, `test_async_query_sending`,
  `test_when_s3_timeout_at_listing`

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-16 07:05:21 +01:00

55 lines
1.9 KiB
Python

import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node", mem_limit='20g')
@pytest.fixture(scope="module", autouse=True)
def start_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
def test_memory_limit_success():
if node.is_built_with_thread_sanitizer():
pytest.skip(
"tsan build is skipped because it slowly merges the parts, "
"rather than failing over the memory limit"
)
if node.is_built_with_memory_sanitizer():
pytest.skip(
"Memory Sanitizer uses more memory, making precise memory limit testing unreliable"
)
node.query(
"CREATE TABLE test_merge_oom ENGINE=AggregatingMergeTree ORDER BY id EMPTY AS SELECT number%1024 AS id, arrayReduce('groupArrayState', arrayMap(x-> randomPrintableASCII(100), range(8192))) fat_state FROM numbers(20000)"
)
node.query("SYSTEM STOP MERGES test_merge_oom")
node.query(
"INSERT INTO test_merge_oom SELECT number%1024 AS id, arrayReduce('groupArrayState', arrayMap( x-> randomPrintableASCII(100), range(8192))) fat_state FROM numbers(3000)"
)
node.query(
"INSERT INTO test_merge_oom SELECT number%1024 AS id, arrayReduce('groupArrayState', arrayMap( x-> randomPrintableASCII(100), range(8192))) fat_state FROM numbers(3000)"
)
node.query(
"INSERT INTO test_merge_oom SELECT number%1024 AS id, arrayReduce('groupArrayState', arrayMap( x-> randomPrintableASCII(100), range(8192))) fat_state FROM numbers(3000)"
)
_, error = node.query_and_get_answer_with_error(
"""
SET optimize_throw_if_noop=1;
SYSTEM START MERGES test_merge_oom;
OPTIMIZE TABLE test_merge_oom FINAL;
"""
)
assert not error
node.query("DROP TABLE test_merge_oom")