Skip to content

Commit 572831f

Browse files
committed
async_insert_race_long flakiness fixes
1. Make the test truly asynchronous. The setting `--async_insert_max_data_size 1` leads to data being flushed synchronously for all inserts in this test. This triggers part creation and extra resource consumption. 2. Do not run the `--wait_for_async_insert` query as a background process with a fixed (50ms) sleep time. If the actual execution time is longer than the anticipated delay time, it may lead to excessive process creation.
1 parent f947f91 commit 572831f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/queries/0_stateless/02481_async_insert_race_long.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
77
# shellcheck source=../shell_config.sh
88
. "$CURDIR"/../shell_config.sh
99

10-
export MY_CLICKHOUSE_CLIENT="$CLICKHOUSE_CLIENT --async_insert_busy_timeout_ms 10 --async_insert_max_data_size 1 --async_insert 1"
10+
export MY_CLICKHOUSE_CLIENT="$CLICKHOUSE_CLIENT --async_insert_busy_timeout_min_ms 50 --async_insert_busy_timeout_max_ms 50 --async_insert 1"
1111

1212
function insert1()
1313
{
@@ -29,11 +29,8 @@ function insert3()
2929
{
3030
local TIMELIMIT=$((SECONDS+$1))
3131
while [ $SECONDS -lt "$TIMELIMIT" ]; do
32-
${MY_CLICKHOUSE_CLIENT} --insert_keeper_fault_injection_probability=0 --wait_for_async_insert 1 -q "INSERT INTO async_inserts_race VALUES (7, 'g') (8, 'h')" &
33-
sleep 0.05
32+
${MY_CLICKHOUSE_CLIENT} --insert_keeper_fault_injection_probability=0 --wait_for_async_insert 1 -q "INSERT INTO async_inserts_race VALUES (7, 'g') (8, 'h')"
3433
done
35-
36-
wait
3734
}
3835

3936
function select1()

0 commit comments

Comments
 (0)