From 03259fc60ae4b04f7a3aec1784030858faf3fc85 Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 11 Mar 2020 13:28:24 +0300 Subject: [PATCH] Trying to improve tests --- .../queries/0_stateless/00834_kill_mutation.sh | 2 ++ ...34_kill_mutation_replicated_zookeeper.reference | 1 + .../00834_kill_mutation_replicated_zookeeper.sh | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00834_kill_mutation.sh b/dbms/tests/queries/0_stateless/00834_kill_mutation.sh index ed04c362401..5b6fc769d6a 100755 --- a/dbms/tests/queries/0_stateless/00834_kill_mutation.sh +++ b/dbms/tests/queries/0_stateless/00834_kill_mutation.sh @@ -59,6 +59,8 @@ ${CLICKHOUSE_CLIENT} --query="KILL MUTATION WHERE database = 'test' AND table = wait ${CLICKHOUSE_CLIENT} --query="SELECT * FROM test.kill_mutation" +# must be empty +${CLICKHOUSE_CLIENT} --query="SELECT * FROM system.mutations WHERE table = 'kill_mutation' AND database = 'test' AND is_done = 0" ${CLICKHOUSE_CLIENT} --query="DROP TABLE test.kill_mutation" diff --git a/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.reference b/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.reference index 9f1aa8e599d..3fe9a065099 100644 --- a/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.reference +++ b/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.reference @@ -2,6 +2,7 @@ 0000000000 1 1 Code: 6, waiting test kill_mutation_r1 0000000000 Mutation 0000000000 was killed +0 *** Create and kill invalid mutation that blocks another mutation *** 0000000001 1 1 Code: 6, waiting test kill_mutation_r1 0000000001 diff --git a/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.sh b/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.sh index 19c3fc4eed3..ec7c48147c4 100755 --- a/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.sh +++ b/dbms/tests/queries/0_stateless/00834_kill_mutation_replicated_zookeeper.sh @@ -36,12 +36,17 @@ ${CLICKHOUSE_CLIENT} --query="KILL MUTATION WHERE database = 'test' AND table = wait -${CLICKHOUSE_CLIENT} --query="SELECT mutation_id FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation_r1'" - +# No active mutations exists +${CLICKHOUSE_CLIENT} --query="SELECT count() FROM system.mutations WHERE database = 'test' AND table = 'kill_mutation_r1'" ${CLICKHOUSE_CLIENT} --query="SELECT '*** Create and kill invalid mutation that blocks another mutation ***'" ${CLICKHOUSE_CLIENT} --query="SYSTEM SYNC REPLICA test.kill_mutation_r1" +${CLICKHOUSE_CLIENT} --query="SYSTEM SYNC REPLICA test.kill_mutation_r2" + +# Should be empty, but in case of problems we will see some diagnostics +${CLICKHOUSE_CLIENT} --query="SELECT * FROM system.replication_queue WHERE table like 'kill_mutation_r%'" + ${CLICKHOUSE_CLIENT} --query="ALTER TABLE test.kill_mutation_r1 DELETE WHERE toUInt32(s) = 1" # good mutation, but blocked with wrong mutation @@ -63,7 +68,12 @@ ${CLICKHOUSE_CLIENT} --query="KILL MUTATION WHERE database = 'test' AND table = wait +${CLICKHOUSE_CLIENT} --query="SYSTEM SYNC REPLICA test.kill_mutation_r1" +${CLICKHOUSE_CLIENT} --query="SYSTEM SYNC REPLICA test.kill_mutation_r2" + ${CLICKHOUSE_CLIENT} --query="SELECT * FROM test.kill_mutation_r2" +# must be empty +${CLICKHOUSE_CLIENT} --query="SELECT * FROM system.mutations WHERE table = 'kill_mutation' AND database = 'test' AND is_done = 0" ${CLICKHOUSE_CLIENT} --query="DROP TABLE test.kill_mutation_r1"