From 7fc1ce6ec7624916299ef62e7e57b90fe7d82546 Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 23 Mar 2020 12:05:51 +0300 Subject: [PATCH 1/2] Fix flacky 00806_alter_update test --- dbms/tests/queries/0_stateless/00806_alter_update.reference | 1 - dbms/tests/queries/0_stateless/00806_alter_update.sql | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00806_alter_update.reference b/dbms/tests/queries/0_stateless/00806_alter_update.reference index fbc804c35ca..0d55bed3a35 100644 --- a/dbms/tests/queries/0_stateless/00806_alter_update.reference +++ b/dbms/tests/queries/0_stateless/00806_alter_update.reference @@ -1,3 +1,2 @@ -0 foo foo diff --git a/dbms/tests/queries/0_stateless/00806_alter_update.sql b/dbms/tests/queries/0_stateless/00806_alter_update.sql index 4b2f1d46f1a..c4fe3969df3 100644 --- a/dbms/tests/queries/0_stateless/00806_alter_update.sql +++ b/dbms/tests/queries/0_stateless/00806_alter_update.sql @@ -4,9 +4,8 @@ CREATE TABLE alter_update_00806 (d Date, e Enum8('foo'=1, 'bar'=2)) Engine = Mer INSERT INTO alter_update_00806 (d, e) VALUES ('2018-01-01', 'foo'); INSERT INTO alter_update_00806 (d, e) VALUES ('2018-01-02', 'bar'); -ALTER TABLE alter_update_00806 UPDATE e = CAST('foo', 'Enum8(\'foo\' = 1, \'bar\' = 2)') WHERE d='2018-01-02'; +ALTER TABLE alter_update_00806 UPDATE e = CAST('foo', 'Enum8(\'foo\' = 1, \'bar\' = 2)') WHERE d='2018-01-02' SETTINGS mutations_sync = 1; -SELECT sleep(1); -- TODO: there should be setting for sync ALTER UPDATE someday. SELECT e FROM alter_update_00806 ORDER BY d; From cfb098cca9d977c15054ce06b4aba75a2480b0f6 Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 23 Mar 2020 12:28:14 +0300 Subject: [PATCH 2/2] Fix bulk of flaky tests --- .../00814_replicated_minimalistic_part_header_zookeeper.sql | 2 +- .../00993_system_parts_race_condition_drop_zookeeper.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00814_replicated_minimalistic_part_header_zookeeper.sql b/dbms/tests/queries/0_stateless/00814_replicated_minimalistic_part_header_zookeeper.sql index 6e15c2d9eaa..2e1df541f14 100644 --- a/dbms/tests/queries/0_stateless/00814_replicated_minimalistic_part_header_zookeeper.sql +++ b/dbms/tests/queries/0_stateless/00814_replicated_minimalistic_part_header_zookeeper.sql @@ -34,7 +34,7 @@ SELECT _part, x FROM test.part_header_r1 ORDER BY x; SELECT '*** replica 2 ***'; SELECT _part, x FROM test.part_header_r2 ORDER BY x; -SELECT sleep(2) FORMAT Null; +SELECT sleep(3) FORMAT Null; SELECT '*** Test part removal ***'; SELECT '*** replica 1 ***'; diff --git a/dbms/tests/queries/0_stateless/00993_system_parts_race_condition_drop_zookeeper.sh b/dbms/tests/queries/0_stateless/00993_system_parts_race_condition_drop_zookeeper.sh index a9d6e51a28b..2d458ba7e28 100755 --- a/dbms/tests/queries/0_stateless/00993_system_parts_race_condition_drop_zookeeper.sh +++ b/dbms/tests/queries/0_stateless/00993_system_parts_race_condition_drop_zookeeper.sh @@ -16,7 +16,7 @@ function thread2() { while true; do REPLICA=$(($RANDOM % 10)) - $CLICKHOUSE_CLIENT -n --query "ALTER TABLE alter_table_$REPLICA ADD COLUMN h String; ALTER TABLE alter_table_$REPLICA MODIFY COLUMN h UInt64; ALTER TABLE alter_table_$REPLICA DROP COLUMN h;"; + $CLICKHOUSE_CLIENT -n --query "ALTER TABLE alter_table_$REPLICA ADD COLUMN h String '0'; ALTER TABLE alter_table_$REPLICA MODIFY COLUMN h UInt64; ALTER TABLE alter_table_$REPLICA DROP COLUMN h;"; done } @@ -51,7 +51,7 @@ function thread6() while true; do REPLICA=$(($RANDOM % 10)) $CLICKHOUSE_CLIENT -n -q "DROP TABLE IF EXISTS alter_table_$REPLICA; - CREATE TABLE alter_table_$REPLICA (a UInt8, b Int16, c Float32, d String, e Array(UInt8), f Nullable(UUID), g Tuple(UInt8, UInt16)) ENGINE = ReplicatedMergeTree('/clickhouse/tables/alter_table', 'r_$REPLICA') ORDER BY a PARTITION BY b % 10 SETTINGS old_parts_lifetime = 1;"; + CREATE TABLE alter_table_$REPLICA (a UInt8, b Int16, c Float32, d String, e Array(UInt8), f Nullable(UUID), g Tuple(UInt8, UInt16)) ENGINE = ReplicatedMergeTree('/clickhouse/tables/alter_table', 'r_$REPLICA') ORDER BY a PARTITION BY b % 10 SETTINGS old_parts_lifetime = 1, cleanup_delay_period = 0, cleanup_delay_period_random_add = 0;"; sleep 0.$RANDOM; done }