mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-20 06:32:08 +00:00
60 lines
1.7 KiB
Bash
60 lines
1.7 KiB
Bash
|
#!/usr/bin/env bash
|
||
|
# Tags: no-fasttest
|
||
|
|
||
|
|
||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||
|
# shellcheck source=../shell_config.sh
|
||
|
. "$CURDIR"/../shell_config.sh
|
||
|
|
||
|
function thread_query()
|
||
|
{
|
||
|
while true; do
|
||
|
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.numbers_mt WHERE rand() = 0 FORMAT Null";
|
||
|
done
|
||
|
}
|
||
|
|
||
|
function thread_cancel()
|
||
|
{
|
||
|
while true; do
|
||
|
$CLICKHOUSE_CLIENT --query "KILL QUERY WHERE 1 SYNC FORMAT Null";
|
||
|
done
|
||
|
}
|
||
|
|
||
|
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
||
|
export -f thread_query;
|
||
|
export -f thread_cancel;
|
||
|
|
||
|
TIMEOUT=30
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
timeout $TIMEOUT bash -c thread_query 2> /dev/null &
|
||
|
timeout $TIMEOUT bash -c thread_cancel 2> /dev/null &
|
||
|
|
||
|
wait
|