ClickHouse/tests/integration/test_settings_randomization/test.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
886 B
Python
Raw Normal View History

2024-09-06 13:50:13 +00:00
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node1", user_configs=["config/users.xml"])
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
def test_settings_randomization(started_cluster):
"""
See tests/integration/helpers/random_settings.py
"""
def q(field, name):
return int(
node.query(
f"SELECT {field} FROM system.settings WHERE name = '{name}'"
).strip()
)
2024-09-06 14:35:33 +00:00
# setting set in test config is not overriden
2024-09-06 13:50:13 +00:00
assert q("value", "max_block_size") == 59999
2024-09-06 14:35:33 +00:00
# some setting is randomized
2024-09-06 13:50:13 +00:00
assert q("changed", "max_joined_block_size_rows") == 1
assert 8000 <= q("value", "max_joined_block_size_rows") <= 100000