2022-05-13 15:39:05 +00:00
#!/usr/bin/env bash
2022-09-07 15:57:29 +00:00
# Tags: no-parallel, no-fasttest
2022-05-13 15:39:05 +00:00
CURDIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
# shellcheck source=../shell_config.sh
. " $CURDIR " /../shell_config.sh
$CLICKHOUSE_CLIENT -q 'DROP USER IF EXISTS u02294'
$CLICKHOUSE_CLIENT -q 'CREATE USER IF NOT EXISTS u02294 IDENTIFIED WITH no_password'
$CLICKHOUSE_CLIENT -q 'GRANT ALL ON *.* TO u02294'
function query( )
{
2022-05-28 18:44:58 +00:00
while true; do
2022-05-13 15:39:05 +00:00
$CLICKHOUSE_CLIENT -u u02294 -q 'SELECT number FROM numbers(130000) GROUP BY number SETTINGS max_memory_usage_for_user=5000000,memory_overcommit_ratio_denominator=2000000000000000000,memory_usage_overcommit_max_wait_microseconds=500' >/dev/null 2>/dev/null
2022-05-28 18:44:58 +00:00
done
2022-05-13 15:39:05 +00:00
}
export -f query
2022-05-28 18:44:58 +00:00
TIMEOUT = 10
2022-05-13 16:27:52 +00:00
for _ in { 1..10} ;
do
2022-05-28 18:44:58 +00:00
timeout $TIMEOUT bash -c query &
2022-05-13 16:27:52 +00:00
done
2022-05-13 15:39:05 +00:00
2022-05-13 16:27:52 +00:00
wait
2022-05-13 15:39:05 +00:00
$CLICKHOUSE_CLIENT -q 'DROP USER IF EXISTS u02294'