Tune 01238_http_memory_tracking to make it more optimal

w/o the patch the test fails with, since it succeed only 512 queries.
This commit is contained in:
Azat Khuzhin 2020-06-22 02:44:13 +03:00
parent c758567e4e
commit 9744c99f7e
2 changed files with 5 additions and 15 deletions

View File

@ -3,27 +3,17 @@
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
# Don't even try to do run under sanitizers, since they are too slow.
${CLICKHOUSE_LOCAL} --query "SELECT max(value LIKE '%sanitize%') FROM system.build_options" | grep -q '1' && echo 'Skip test for sanitizer build' && exit
# TODO: the test can be way more optimal
set -o pipefail
function execute_null()
{
${CLICKHOUSE_CLIENT} --format Null -n "$@"
}
# This is needed to keep at least one running query for user for the time of test.
# (10k http queries takes 10seconds, let's run for 3x more to avoid flaps)
execute_null <<<'SELECT sleepEachRow(1) FROM numbers(30)' &
# (1k http queries takes ~1 second, let's run for 5x more to avoid flaps)
${CLICKHOUSE_CLIENT} --format Null -n <<<'SELECT sleepEachRow(1) FROM numbers(5)' &
# ignore "yes: standard output: Broken pipe"
yes 'SELECT 1' 2>/dev/null | {
head -n10000
head -n1000
} | {
xargs -P10000 -i ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&wait_end_of_query=1&max_memory_usage_for_user=$((10<<30))" -d '{}'
xargs -i ${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&wait_end_of_query=1&max_memory_usage_for_user=$((1<<30))" -d '{}'
} | grep -x -c 1
wait