fix flaky test '02497_trace_events_stress_long'

This commit is contained in:
Anton Popov 2022-12-10 14:02:12 +00:00
parent 3e3738bd49
commit 0b42605053

View File

@ -9,9 +9,9 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
function thread1()
{
query_id="$RANDOM-$CLICKHOUSE_DATABASE"
thread_id=$1
while true; do
query_id="02497_$CLICKHOUSE_DATABASE-$RANDOM-$thread_id"
$CLICKHOUSE_CLIENT --query_id=$query_id --query "
SELECT count() FROM numbers_mt(100000) SETTINGS
trace_profile_events = 1,
@ -35,13 +35,13 @@ export -f thread2
TIMEOUT=10
timeout $TIMEOUT bash -c thread1 >/dev/null &
timeout $TIMEOUT bash -c thread1 >/dev/null &
timeout $TIMEOUT bash -c thread1 >/dev/null &
timeout $TIMEOUT bash -c thread1 >/dev/null &
timeout $TIMEOUT bash -c "thread1 0" >/dev/null &
timeout $TIMEOUT bash -c "thread1 1" >/dev/null &
timeout $TIMEOUT bash -c "thread1 2" >/dev/null &
timeout $TIMEOUT bash -c "thread1 3" >/dev/null &
timeout $TIMEOUT bash -c thread2 >/dev/null &
wait
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE query_id = '$query_id' SYNC"
$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes WHERE query_id = '$query_id'"
$CLICKHOUSE_CLIENT -q "KILL QUERY WHERE query_id LIKE '02497_$CLICKHOUSE_DATABASE%' SYNC" >/dev/null
$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes WHERE query_id LIKE '02497_$CLICKHOUSE_DATABASE%'"