Add a test for Distributed query finish does not produce any NETWORK_ERROR

This commit is contained in:
Azat Khuzhin 2020-11-14 14:22:21 +03:00
parent a6f6e5c408
commit ed64f2ad67
3 changed files with 37 additions and 0 deletions

View File

@ -287,6 +287,8 @@ TESTS_TO_SKIP=(
01322_ttest_scipy
01545_system_errors
# Checks system.errors
01563_distributed_query_finish
)
time clickhouse-test -j 8 --order=random --no-long --testname --shard --zookeeper --skip "${TESTS_TO_SKIP[@]}" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee "$FASTTEST_OUTPUT/test_log.txt"

View File

@ -0,0 +1,2 @@
1,0
NETWORK_ERROR=0

View File

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# query finish should not produce any NETWORK_ERROR
# (NETWORK_ERROR will be in case of connection reset)
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -nm <<EOL
drop table if exists dist_01247;
drop table if exists data_01247;
create table data_01247 engine=Memory() as select * from numbers(2);
create table dist_01247 as data_01247 engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01247, number);
select * from dist_01247 format Null;
EOL
network_errors_before=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
opts=(
"--max_distributed_connections=1"
"--optimize_skip_unused_shards=1"
"--optimize_distributed_group_by_sharding_key=1"
"--prefer_localhost_replica=0"
)
$CLICKHOUSE_CLIENT "${opts[@]}" --format CSV -nm <<EOL
select count(), * from dist_01247 group by number limit 1;
EOL
# expect zero new network errors
network_errors_after=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
echo NETWORK_ERROR=$(( network_errors_after-network_errors_before ))