Merge pull request #27023 from Algunenano/flaky_drop_create_merge

Attempt to fix flaky 00705_drop_create_merge_tree
This commit is contained in:
alexey-milovidov 2021-07-30 19:45:22 +03:00 committed by GitHub
commit f17b5debfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,10 +7,20 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
function stress() function stress()
{ {
while true; do # 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 "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 ${CLICKHOUSE_CLIENT} --query "DROP TABLE table" 2>/dev/null
done done
trap - INT
} }
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout # https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
@ -18,7 +28,7 @@ export -f stress
for _ in {1..5}; do for _ in {1..5}; do
# Ten seconds are just barely enough to reproduce the issue in most of runs. # Ten seconds are just barely enough to reproduce the issue in most of runs.
timeout 10 bash -c stress & timeout -s INT 10 bash -c stress &
done done
wait wait