Skip to content

Commit 7929bc0

Browse files
committed
fix 03221_insert_timeout_overflow_mode flaky
1 parent 51f24b4 commit 7929bc0

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

tests/queries/0_stateless/03221_insert_timeout_overflow_mode.reference

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
TIMEOUT_EXCEEDED
2-
TIMEOUT_EXCEEDED
1+
timeout_overflow_mode throw OK
32
QUERY_WAS_CANCELLED
43
QUERY_WAS_CANCELLED
54
QUERY_WAS_CANCELLED

tests/queries/0_stateless/03221_insert_timeout_overflow_mode.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,32 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
66

77
${CLICKHOUSE_CLIENT} --query "create table dst (number UInt64) engine = MergeTree ORDER BY number;"
88

9-
${CLICKHOUSE_CLIENT} --query "select number + sleep(0.1) as number from system.numbers limit 10 settings max_block_size = 1 format Native" 2>/dev/null | ${CLICKHOUSE_CLIENT} --max_execution_time 0.3 --timeout_overflow_mode throw --query "insert into dst format Native" 2>&1 | grep -o "TIMEOUT_EXCEEDED"
9+
error=$(${CLICKHOUSE_CLIENT} --query "select number + sleep(0.1) as number from system.numbers limit 10 settings max_block_size = 1 format Native" 2>/dev/null | ${CLICKHOUSE_CLIENT} --max_execution_time 0.3 --timeout_overflow_mode throw --query "insert into dst format Native" 2>&1 ||:)
10+
11+
function check_error()
12+
{
13+
error="$1"
14+
15+
if echo "$error" | grep "TIMEOUT_EXCEEDED" > /dev/null
16+
then
17+
echo "timeout_overflow_mode throw OK"
18+
return 0
19+
fi
20+
21+
if echo "$error" | grep "QUERY_WAS_CANCELLED" | grep "is killed in pending state" > /dev/null
22+
then
23+
echo "timeout_overflow_mode throw OK"
24+
return 0
25+
fi
26+
27+
echo "Query ended in unexpected way:"
28+
echo "$error"
29+
return 1
30+
}
31+
32+
check_error "$error"
1033

1134
# this is the tests with PushingPipelineExecutor
1235
${CLICKHOUSE_CLIENT} --query "select number + sleep(0.1) as number from system.numbers limit 10 settings max_block_size = 1 format Native" 2>/dev/null | ${CLICKHOUSE_CLIENT} --max_threads=1 --max_execution_time 0.3 --timeout_overflow_mode break --query "insert into dst format Native" 2>&1 | grep -o "QUERY_WAS_CANCELLED"
13-
1436
# this is the tests with PushingPipelineExecutorPushingAsyncPipelineExecutor
1537
${CLICKHOUSE_CLIENT} --query "select number + sleep(0.1) as number from system.numbers limit 10 settings max_block_size = 1 format Native" 2>/dev/null | ${CLICKHOUSE_CLIENT} --max_threads=3 --max_execution_time 0.3 --timeout_overflow_mode break --query "insert into dst format Native" 2>&1 | grep -o "QUERY_WAS_CANCELLED"

0 commit comments

Comments
 (0)