Skip to content

Commit ffd6bf2

Browse files
committed
tests: fix 01563_distributed_query_finish flakiness (due to system.*_log_sender)
From CI logs [1], during this test was executing on server: 2024.07.05 19:29:45.856853 [ 1328 ] {} <Error> system.zookeeper_log_sender.DistributedInsertQueue.default: Code: 210. DB::NetException: Connection reset by peer, while writing to socket (172.17.0.2:38546 -> 3.16.142.177:9440): While sending /var/lib/clickhouse/store/aa8/aa8f6e66-486b-4dc3-85a1-4941e69cb99f/shard1_replica1/447.bin. (NETWORK_ERROR), Stack trace (when copying this message, always include the lines below): [1]: https://s3.amazonaws.com/clickhouse-test-reports/66162/daae5d4d4661c780b6368950ec484415ca3a0492/stateless_tests__aarch64_.html So let's add retries Signed-off-by: Azat Khuzhin <[email protected]>
1 parent 77e7850 commit ffd6bf2

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
1,0
21
NETWORK_ERROR=0

tests/queries/0_stateless/01563_distributed_query_finish.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,25 @@ create table dist_01247 as data_01247 engine=Distributed(test_cluster_two_shards
1919
select * from dist_01247 format Null;
2020
EOL
2121

22-
network_errors_before=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
23-
24-
opts=(
25-
"--max_distributed_connections=1"
26-
"--optimize_skip_unused_shards=1"
27-
"--optimize_distributed_group_by_sharding_key=1"
28-
"--prefer_localhost_replica=0"
29-
)
30-
$CLICKHOUSE_CLIENT "${opts[@]}" --format CSV -nm <<EOL
31-
select count(), * from dist_01247 group by number order by number limit 1;
32-
EOL
33-
34-
# expect zero new network errors
35-
network_errors_after=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
22+
# NOTE: it is possible to got NETWORK_ERROR even with no-parallel, at least due to system.*_log_sender to the cloud
23+
for ((i = 0; i < 100; ++i)); do
24+
network_errors_before=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
25+
26+
opts=(
27+
"--max_distributed_connections=1"
28+
"--optimize_skip_unused_shards=1"
29+
"--optimize_distributed_group_by_sharding_key=1"
30+
"--prefer_localhost_replica=0"
31+
)
32+
$CLICKHOUSE_CLIENT "${opts[@]}" --format CSV -nm -q "select count(), * from dist_01247 group by number order by number limit 1 format Null"
33+
34+
# expect zero new network errors
35+
network_errors_after=$($CLICKHOUSE_CLIENT -q "SELECT value FROM system.errors WHERE name = 'NETWORK_ERROR'")
36+
37+
if [[ $((network_errors_after-network_errors_before)) -eq 0 ]]; then
38+
break
39+
fi
40+
done
3641
echo NETWORK_ERROR=$(( network_errors_after-network_errors_before ))
3742

3843
$CLICKHOUSE_CLIENT -q "drop table data_01247"

0 commit comments

Comments
 (0)