Merge pull request #23823 from azat/tests-wait

Improve 00840_long_concurrent_select_and_drop_deadlock
This commit is contained in:
alexey-milovidov 2021-05-01 08:30:32 +03:00 committed by GitHub
commit 711cc5f62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,10 +6,28 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
for _ in {1..200}; do echo "drop table if exists view_00840" | $CLICKHOUSE_CLIENT; echo "create view view_00840 as select count(*),database,table from system.columns group by database,table" | $CLICKHOUSE_CLIENT; done &
for _ in {1..500}; do echo "select * from view_00840 order by table" | $CLICKHOUSE_CLIENT >/dev/null 2>&1 || true; done &
function cleanup()
{
echo Failed
wait
}
trap cleanup EXIT
$CLICKHOUSE_CLIENT -q "create view view_00840 as select count(*),database,table from system.columns group by database,table"
for _ in {1..200}; do
$CLICKHOUSE_CLIENT -nm -q "
drop table if exists view_00840;
create view view_00840 as select count(*),database,table from system.columns group by database,table;
"
done &
for _ in {1..500}; do
$CLICKHOUSE_CLIENT -q "select * from view_00840 order by table" >/dev/null 2>&1 || true
done &
wait
trap '' EXIT
echo "drop table view_00840" | $CLICKHOUSE_CLIENT