From 7794ac66d4d272058d814785c47222e9b61391c1 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 3 Mar 2021 23:32:53 +0300 Subject: [PATCH] Fix flaky tests with distributed queries There was few attempts to fix this [1] and [2], but it still pops up sometimes, for example here [3]. [1]: 009f57fc2fc8 / #11211 [2]: cdb6bed8b98e / #14198 [3]: https://clickhouse-test-reports.s3.yandex.net/21318/38be9ff43ac4c46ce6e803fc125d910bde1d4c71/functional_stateless_tests_(release,_databasereplicated).html#fail1 Let's use more generic approach, and do not hide any errors (and see does increasing timeout will be enough). --- tests/config/install.sh | 1 + tests/config/users.d/remote_queries.xml | 9 +++++++++ tests/queries/0_stateless/00974_distributed_join_on.sql | 4 ---- .../01244_optimize_distributed_group_by_sharding_key.sql | 4 ---- ...ze_distributed_group_by_sharding_key_dist_on_dist.sql | 4 ---- tests/queries/0_stateless/01293_show_settings.reference | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 tests/config/users.d/remote_queries.xml diff --git a/tests/config/install.sh b/tests/config/install.sh index de6ba2a7a09..9b29e758fd0 100755 --- a/tests/config/install.sh +++ b/tests/config/install.sh @@ -39,6 +39,7 @@ ln -sf $SRC_PATH/users.d/readonly.xml $DEST_SERVER_PATH/users.d/ ln -sf $SRC_PATH/users.d/access_management.xml $DEST_SERVER_PATH/users.d/ ln -sf $SRC_PATH/users.d/database_atomic_drop_detach_sync.xml $DEST_SERVER_PATH/users.d/ ln -sf $SRC_PATH/users.d/opentelemetry.xml $DEST_SERVER_PATH/users.d/ +ln -sf $SRC_PATH/users.d/remote_queries.xml $DEST_SERVER_PATH/users.d/ ln -sf $SRC_PATH/ints_dictionary.xml $DEST_SERVER_PATH/ ln -sf $SRC_PATH/strings_dictionary.xml $DEST_SERVER_PATH/ diff --git a/tests/config/users.d/remote_queries.xml b/tests/config/users.d/remote_queries.xml new file mode 100644 index 00000000000..20f72034235 --- /dev/null +++ b/tests/config/users.d/remote_queries.xml @@ -0,0 +1,9 @@ + + + + + 2000 + 3000 + + + diff --git a/tests/queries/0_stateless/00974_distributed_join_on.sql b/tests/queries/0_stateless/00974_distributed_join_on.sql index 10f8763fa33..355d9f81e82 100644 --- a/tests/queries/0_stateless/00974_distributed_join_on.sql +++ b/tests/queries/0_stateless/00974_distributed_join_on.sql @@ -1,7 +1,3 @@ --- Avoid "Connection failed at try №1" messages. -SET send_logs_level = 'none'; -SET connect_timeout_with_failover_ms = 5000; - DROP TABLE IF EXISTS source_table1; DROP TABLE IF EXISTS source_table2; DROP TABLE IF EXISTS distributed_table1; diff --git a/tests/queries/0_stateless/01244_optimize_distributed_group_by_sharding_key.sql b/tests/queries/0_stateless/01244_optimize_distributed_group_by_sharding_key.sql index d152326091b..2f77155cc54 100644 --- a/tests/queries/0_stateless/01244_optimize_distributed_group_by_sharding_key.sql +++ b/tests/queries/0_stateless/01244_optimize_distributed_group_by_sharding_key.sql @@ -1,9 +1,5 @@ -- TODO: correct testing with real unique shards --- Avoid "Connection failed at try №1" messages. -SET send_logs_level = 'fatal'; -SET connect_timeout_with_failover_ms = 5000; - set optimize_distributed_group_by_sharding_key=1; drop table if exists dist_01247; diff --git a/tests/queries/0_stateless/01247_optimize_distributed_group_by_sharding_key_dist_on_dist.sql b/tests/queries/0_stateless/01247_optimize_distributed_group_by_sharding_key_dist_on_dist.sql index 1000e956583..73dc916e463 100644 --- a/tests/queries/0_stateless/01247_optimize_distributed_group_by_sharding_key_dist_on_dist.sql +++ b/tests/queries/0_stateless/01247_optimize_distributed_group_by_sharding_key_dist_on_dist.sql @@ -1,9 +1,5 @@ -- TODO: correct testing with real unique shards --- Avoid "Connection failed at try №1" messages. -SET send_logs_level = 'fatal'; -SET connect_timeout_with_failover_ms = 5000; - set optimize_distributed_group_by_sharding_key=1; drop table if exists dist_01247; diff --git a/tests/queries/0_stateless/01293_show_settings.reference b/tests/queries/0_stateless/01293_show_settings.reference index feebc9e473d..6fcbf194614 100644 --- a/tests/queries/0_stateless/01293_show_settings.reference +++ b/tests/queries/0_stateless/01293_show_settings.reference @@ -1,5 +1,5 @@ send_timeout Seconds 300 connect_timeout Seconds 10 -connect_timeout_with_failover_ms Milliseconds 50 -connect_timeout_with_failover_secure_ms Milliseconds 100 +connect_timeout_with_failover_ms Milliseconds 2000 +connect_timeout_with_failover_secure_ms Milliseconds 3000 max_memory_usage UInt64 10000000000