Update test.Fix ya.make.

This commit is contained in:
Nikolai Kochetov 2021-01-26 16:58:49 +03:00
parent 66fe97d8bd
commit 578f36e4f3
3 changed files with 12 additions and 3 deletions

View File

@ -117,6 +117,7 @@ SRCS(
QueryPlan/MergingSortedStep.cpp
QueryPlan/OffsetStep.cpp
QueryPlan/PartialSortingStep.cpp
QueryPlan/QueryIdHolder.cpp
QueryPlan/QueryPlan.cpp
QueryPlan/ReadFromPreparedSource.cpp
QueryPlan/ReadNothingStep.cpp

View File

@ -12,3 +12,5 @@ Check if another query is passed
Modify max_concurrent_queries back to 1
Check if another query with less marks to read is throttled
yes
was cancelled
finished long_running_query default select sleepEachRow(0.01) from simple settings max_block_size = 1 format Null

View File

@ -4,18 +4,23 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
function wait_for_query_to_start()
{
while [[ $($CLICKHOUSE_CURL -sS "$CLICKHOUSE_URL" -d "SELECT sum(read_rows) FROM system.processes WHERE query_id = '$1'") == 0 ]]; do sleep 0.1; done
}
${CLICKHOUSE_CLIENT} --multiline --multiquery --query "
drop table if exists simple;
create table simple (i int, j int) engine = MergeTree order by i
settings index_granularity = 1, max_concurrent_queries = 1, min_marks_to_honor_max_concurrent_queries = 2;
insert into simple select number, number + 100 from numbers(10);
insert into simple select number, number + 100 from numbers(1000);
"
echo "Spin up a long running query"
${CLICKHOUSE_CLIENT} --query "select sleepEachRow(1) from simple settings max_block_size = 1 format Null" --query_id "long_running_query" &
sleep 3
${CLICKHOUSE_CLIENT} --query "select sleepEachRow(0.01) from simple settings max_block_size = 1 format Null" --query_id "long_running_query" 2>&1 | grep -o 'was cancelled' | head -1 &
wait_for_query_to_start 'long_running_query'
# query which reads marks >= min_marks_to_honor_max_concurrent_queries is throttled
echo "Check if another query with some marks to read is throttled"
@ -56,6 +61,7 @@ CODE=$?
[ "$CODE" -ne "202" ] && echo "Expected error code: 202 but got: $CODE" && exit 1;
echo "yes"
${CLICKHOUSE_CLIENT} --query "KILL QUERY WHERE query_id = 'long_running_query' SYNC"
wait
${CLICKHOUSE_CLIENT} --multiline --multiquery --query "