ClickHouse/tests/queries/0_stateless/00746_sql_fuzzy.sh
Azat Khuzhin d28963d695 tests: do not leave any queries after finish
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>
2022-03-09 17:29:33 +03:00

28 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Tags: long
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
export SQL_FUZZY_FILE_FUNCTIONS=${CLICKHOUSE_TMP}/clickhouse-functions
$CLICKHOUSE_CLIENT -q "select name from system.functions format TSV;" > "$SQL_FUZZY_FILE_FUNCTIONS"
export SQL_FUZZY_FILE_TABLE_FUNCTIONS=${CLICKHOUSE_TMP}/clickhouse-table_functions
$CLICKHOUSE_CLIENT -q "select name from system.table_functions format TSV;" > "$SQL_FUZZY_FILE_TABLE_FUNCTIONS"
# This is short run for ordinary tests.
# if you want long run use: env SQL_FUZZY_RUNS=100000 clickhouse-test sql_fuzzy
for SQL_FUZZY_RUN in $(seq "${SQL_FUZZY_RUNS:=5}"); do
env SQL_FUZZY_RUN="$SQL_FUZZY_RUN" perl "$CURDIR"/00746_sql_fuzzy.pl | clickhouse_client_timeout 60 $CLICKHOUSE_CLIENT --format Null --max_execution_time 10 -n --ignore-error >/dev/null 2>&1
if [[ $($CLICKHOUSE_CLIENT -q "SELECT 'Still alive'") != 'Still alive' ]]; then
break
fi
done
$CLICKHOUSE_CLIENT -q "SELECT 'Still alive'"
# Query replay:
# cat clickhouse-server.log | grep -aF "<Debug> executeQuery: (from " | perl -lpe 's/^.*executeQuery: \(from \S+\) (.*)/$1;/' | clickhouse-client -n --ignore-error