From 2b7818ba6d961202407099bdeaafff271d32b28d Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 29 Apr 2021 10:43:56 +0300 Subject: [PATCH] Improve 00840_long_concurrent_select_and_drop_deadlock Improve waiting in the test to avoid hung check triggering [1]. [1]: https://clickhouse-test-reports.s3.yandex.net/23744/73ab415c4c27e481cddf4d6d70b24e79fb8d8941/stress_test_(thread).html#fail1 --- ...ong_concurrent_select_and_drop_deadlock.sh | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/queries/0_stateless/00840_long_concurrent_select_and_drop_deadlock.sh b/tests/queries/0_stateless/00840_long_concurrent_select_and_drop_deadlock.sh index 60a2d8eb9a0..0a68225a31a 100755 --- a/tests/queries/0_stateless/00840_long_concurrent_select_and_drop_deadlock.sh +++ b/tests/queries/0_stateless/00840_long_concurrent_select_and_drop_deadlock.sh @@ -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