update test

This commit is contained in:
Guillaume Tassery 2019-12-20 04:30:51 +01:00
parent abbbf3e726
commit 2977289b57

View File

@ -1,3 +1,4 @@
import time
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.client import QueryRuntimeException
@ -43,9 +44,6 @@ def test_dictionary_ddl_on_cluster(started_cluster):
assert node.query("SELECT count() from sometbl") == "1\n"
assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == node.name + '\n'
instance = started_cluster.instances['ch1']
started_cluster.ddl_check_query(instance, "SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' default.somedict")
ch1.query("DETACH DICTIONARY default.somedict ON CLUSTER 'cluster'")
for node in [ch1, ch2, ch3, ch4]:
@ -58,6 +56,16 @@ def test_dictionary_ddl_on_cluster(started_cluster):
assert node.query("SELECT count() from sometbl") == "1\n"
assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == node.name + '\n'
for num, node in enumerate([ch1, ch2, ch3, ch4]):
node.query("ALTER TABLE sometbl UPDATE value = 'new_key' WHERE 1")
ch1.query("SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' `default.somedict`")
time.sleep(2) # SYSTEN RELOAD is a asynchronous query
for num, node in enumerate([ch1, ch2, ch3, ch4]):
assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == 'new_key' + '\n'
ch1.query("DROP DICTIONARY default.somedict ON CLUSTER 'cluster'")
for node in [ch1, ch2, ch3, ch4]: