mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #42522 from azat/tests/00705_drop_create_merge_tree
tests: fix 00705_drop_create_merge_tree flakiness
This commit is contained in:
commit
46559d659b
@ -1,39 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest
|
||||
|
||||
set -e
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
function stress()
|
||||
{
|
||||
# We set up a signal handler to make sure to wait for all queries to be finished before ending
|
||||
CONTINUE=true
|
||||
handle_interruption()
|
||||
{
|
||||
CONTINUE=false
|
||||
}
|
||||
trap handle_interruption INT
|
||||
|
||||
while $CONTINUE; do
|
||||
${CLICKHOUSE_CLIENT} --query "CREATE TABLE IF NOT EXISTS table (x UInt8) ENGINE = MergeTree ORDER BY tuple()" 2>/dev/null
|
||||
${CLICKHOUSE_CLIENT} --query "DROP TABLE table" 2>/dev/null
|
||||
done
|
||||
|
||||
trap - INT
|
||||
}
|
||||
|
||||
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
||||
export -f stress
|
||||
|
||||
for _ in {1..5}; do
|
||||
# Ten seconds are just barely enough to reproduce the issue in most of runs.
|
||||
timeout -s INT 10 bash -c stress &
|
||||
done
|
||||
|
||||
yes 'CREATE TABLE IF NOT EXISTS table (x UInt8) ENGINE = MergeTree ORDER BY tuple();' | head -n 1000 | $CLICKHOUSE_CLIENT --ignore-error -nm 2>/dev/null &
|
||||
yes 'DROP TABLE table;' | head -n 1000 | $CLICKHOUSE_CLIENT --ignore-error -nm 2>/dev/null &
|
||||
wait
|
||||
echo
|
||||
|
||||
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS table";
|
||||
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS table"
|
||||
|
Loading…
Reference in New Issue
Block a user