mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Get back 01281_group_by_limit_memory_tracking (without flackiness)
This commit is contained in:
parent
36c7a486a1
commit
aa5247f1fe
34
tests/queries/0_stateless/01281_group_by_limit_memory_tracking.sh
Executable file
34
tests/queries/0_stateless/01281_group_by_limit_memory_tracking.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Regression for MemoryTracker that had been incorrectly accounted
|
||||
# (it was reseted before deallocation)
|
||||
#
|
||||
# For this will be used:
|
||||
# - two-level group by
|
||||
# - max_memory_usage_for_user
|
||||
# - one users' query in background (to avoid reseting max_memory_usage_for_user)
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
set -o pipefail
|
||||
|
||||
function execute_null()
|
||||
{
|
||||
${CLICKHOUSE_CLIENT} --format Null -n "$@"
|
||||
}
|
||||
|
||||
function execute_group_by()
|
||||
{
|
||||
local opts=(
|
||||
--max_memory_usage_for_user=$((150<<20))
|
||||
--max_threads=2
|
||||
)
|
||||
execute_null "${opts[@]}" <<<'SELECT uniq(number) FROM numbers_mt(toUInt64(1e6)) GROUP BY number % 5e5'
|
||||
}
|
||||
|
||||
execute_null <<<'SELECT sleep(3)' &
|
||||
execute_group_by
|
||||
# if memory accounting will be incorrect, the second query will be failed with MEMORY_LIMIT_EXCEEDED
|
||||
execute_group_by
|
||||
wait
|
Loading…
Reference in New Issue
Block a user