ClickHouse/tests/queries/0_stateless/01671_ddl_hang_timeout_long.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

30 lines
987 B
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
function thread_create_drop_table()
{
REPLICA=$(($RANDOM % 10))
$CLICKHOUSE_CLIENT --query "CREATE TABLE IF NOT EXISTS t1 (x UInt64, s Array(Nullable(String))) ENGINE = ReplicatedMergeTree('/clickhouse/tables/$CLICKHOUSE_TEST_ZOOKEEPER_PREFIX/test_01671', 'r_$REPLICA') order by x" 2>/dev/null
sleep 0.0$RANDOM
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS t1"
}
function thread_alter_table()
{
$CLICKHOUSE_CLIENT --query "ALTER TABLE $CLICKHOUSE_DATABASE.t1 on cluster test_shard_localhost ADD COLUMN newcol UInt32" >/dev/null 2>&1
sleep 0.0$RANDOM
}
export -f thread_create_drop_table
export -f thread_alter_table
clickhouse_client_loop_timeout 20 thread_create_drop_table &
clickhouse_client_loop_timeout 20 thread_alter_table &
wait
sleep 1
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS t1";