Added a test

This commit is contained in:
Alexey Milovidov 2020-06-08 01:49:26 +03:00
parent 834f8426e0
commit d5443293a3
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Memory limit (for query) exceeded
Ok

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
function test()
{
for i in {1..1000}; do
$CLICKHOUSE_CLIENT --max_memory_usage 1G <<< "SELECT uniqExactState(number) FROM system.numbers_mt GROUP BY number % 10";
done
}
export -f test;
# If the memory leak exists, it will lead to OOM fairly quickly.
timeout 30 bash -c test 2>&1 | grep -o -F 'Memory limit (for query) exceeded' | uniq
echo 'Ok'