mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-13 11:04:10 +00:00
d28963d695
This should fix issues like [1], where because one query from the previous test was left the next fails, in this particular report the problem was that 01281_group_by_limit_memory_tracking fails due to the query from 01301_aggregate_state_exception_memory_leak was running in background. [1]: https://s3.amazonaws.com/clickhouse-test-reports/34919/311f884d3d4215f7f82c2dd66ea51d071d313241/stateless_tests__thread__actions__[2/3].html v2: wait for queries in 01249_flush_interactive Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
33 lines
1.3 KiB
Bash
Executable File
33 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
# shellcheck source=../shell_config.sh
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
# A question for curious reader:
|
|
# How to break shell pipeline as soon as 5 lines are found in the following command:
|
|
# ./my-program | head -n5
|
|
# When I tried to do it, pipeline was not actively terminated,
|
|
# unless the my-program will try to output a thousand more lines overflowing pipe buffer and terminating with Broken Pipe.
|
|
# But if my program just output 5 (or slightly more) lines and hang up, the pipeline is not terminated.
|
|
|
|
function test()
|
|
{
|
|
timeout 5 ${CLICKHOUSE_LOCAL} --max_execution_time 10 --query "
|
|
SELECT DISTINCT number % 5 FROM system.numbers" ||:
|
|
echo '---'
|
|
timeout 5 ${CLICKHOUSE_CURL} -sS --no-buffer "${CLICKHOUSE_URL}&max_execution_time=10" --data-binary "
|
|
SELECT DISTINCT number % 5 FROM system.numbers" ||:
|
|
echo '---'
|
|
}
|
|
|
|
# The test depends on timeouts. And there is a chance that under high system load the query
|
|
# will not be able to finish in 5 seconds (this will lead to test flakiness).
|
|
# Let's check that is will be able to show the expected result at least once.
|
|
while true; do
|
|
[[ $(test) == $(echo -ne "0\n1\n2\n3\n4\n---\n0\n1\n2\n3\n4\n---\n") ]] && break
|
|
sleep 1
|
|
done
|
|
|
|
clickhouse_test_wait_queries 60
|