2018-09-07 01:39:48 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2018-09-07 01:39:48 +00:00
|
|
|
|
|
|
|
function stress()
|
|
|
|
{
|
|
|
|
while true; do
|
2019-04-16 14:13:13 +00:00
|
|
|
${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
|
2018-09-07 01:39:48 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
|
|
|
export -f stress
|
|
|
|
|
2020-08-01 00:40:56 +00:00
|
|
|
for _ in {1..5}; do
|
2018-09-07 01:49:26 +00:00
|
|
|
# Ten seconds are just barely enough to reproduce the issue in most of runs.
|
2018-09-07 01:39:48 +00:00
|
|
|
timeout 10 bash -c stress &
|
|
|
|
done
|
|
|
|
|
|
|
|
wait
|
|
|
|
echo
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS table";
|