mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Fix tests
This commit is contained in:
parent
bad1603ea3
commit
46fa87b14e
@ -100,29 +100,29 @@ def test_select_clamps_settings():
|
||||
# Check that shards clamp passed settings.
|
||||
query = "SELECT hostName() as host, name, value FROM shard_settings WHERE name = 'max_memory_usage' OR name = 'readonly' ORDER BY host, name, value"
|
||||
assert (
|
||||
distributed.query(query) == "node1\tmax_memory_usage\t99999999\n"
|
||||
distributed.query(query) == "node1\tmax_memory_usage\t50000000\n"
|
||||
"node1\treadonly\t0\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
assert (
|
||||
distributed.query(query, user="normal") == "node1\tmax_memory_usage\t80000000\n"
|
||||
"node1\treadonly\t0\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
assert (
|
||||
distributed.query(query, user="wasteful")
|
||||
== "node1\tmax_memory_usage\t99999999\n"
|
||||
"node1\treadonly\t0\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
assert (
|
||||
distributed.query(query, user="readonly")
|
||||
== "node1\tmax_memory_usage\t99999999\n"
|
||||
== "node1\tmax_memory_usage\t50000000\n"
|
||||
"node1\treadonly\t1\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
|
||||
@ -130,14 +130,14 @@ def test_select_clamps_settings():
|
||||
distributed.query(query, settings={"max_memory_usage": 1})
|
||||
== "node1\tmax_memory_usage\t11111111\n"
|
||||
"node1\treadonly\t0\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
assert (
|
||||
distributed.query(query, settings={"max_memory_usage": 40000000, "readonly": 2})
|
||||
== "node1\tmax_memory_usage\t40000000\n"
|
||||
"node1\treadonly\t2\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
assert (
|
||||
@ -146,7 +146,7 @@ def test_select_clamps_settings():
|
||||
)
|
||||
== "node1\tmax_memory_usage\t99999999\n"
|
||||
"node1\treadonly\t2\n"
|
||||
"node2\tmax_memory_usage\t10000000000\n"
|
||||
"node2\tmax_memory_usage\t0\n"
|
||||
"node2\treadonly\t1\n"
|
||||
)
|
||||
|
||||
|
@ -115,7 +115,7 @@ def test_smoke():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 80000000", user="robin")
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
@ -158,7 +158,7 @@ def test_smoke():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 80000000", user="robin")
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
@ -228,7 +228,7 @@ def test_settings_from_granted_role():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
|
||||
@ -240,7 +240,7 @@ def test_settings_from_granted_role():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
assert system_settings_profile_elements(role_name="worker") == []
|
||||
@ -278,7 +278,7 @@ def test_settings_from_granted_role():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
assert system_settings_profile("xyz") == [
|
||||
@ -360,7 +360,7 @@ def test_alter_and_drop():
|
||||
"SELECT value FROM system.settings WHERE name = 'max_memory_usage'",
|
||||
user="robin",
|
||||
)
|
||||
== "10000000000\n"
|
||||
== "0\n"
|
||||
)
|
||||
instance.query("SET max_memory_usage = 80000000", user="robin")
|
||||
instance.query("SET max_memory_usage = 120000000", user="robin")
|
||||
@ -374,17 +374,17 @@ def test_show_profiles():
|
||||
assert instance.query("SHOW CREATE PROFILE xyz") == "CREATE SETTINGS PROFILE xyz\n"
|
||||
assert (
|
||||
instance.query("SHOW CREATE SETTINGS PROFILE default")
|
||||
== "CREATE SETTINGS PROFILE default SETTINGS max_memory_usage = 10000000000, load_balancing = \\'random\\'\n"
|
||||
== "CREATE SETTINGS PROFILE default SETTINGS load_balancing = \\'random\\'\n"
|
||||
)
|
||||
assert (
|
||||
instance.query("SHOW CREATE PROFILES")
|
||||
== "CREATE SETTINGS PROFILE default SETTINGS max_memory_usage = 10000000000, load_balancing = \\'random\\'\n"
|
||||
== "CREATE SETTINGS PROFILE default SETTINGS load_balancing = \\'random\\'\n"
|
||||
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
|
||||
"CREATE SETTINGS PROFILE xyz\n"
|
||||
)
|
||||
|
||||
expected_access = (
|
||||
"CREATE SETTINGS PROFILE default SETTINGS max_memory_usage = 10000000000, load_balancing = \\'random\\'\n"
|
||||
"CREATE SETTINGS PROFILE default SETTINGS load_balancing = \\'random\\'\n"
|
||||
"CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1\n"
|
||||
"CREATE SETTINGS PROFILE xyz\n"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user