Add max time limit to 00840_long_concurrent_select_and_drop_deadlock

This commit is contained in:
Raúl Marín 2024-05-27 15:04:41 +02:00
parent 4d63bc24a5
commit bf3762db20

View File

@ -19,15 +19,39 @@ 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..100}; do
function thread_drop_create()
{
local TIMELIMIT=$((SECONDS+$1))
local it=0
while [ $SECONDS -lt "$TIMELIMIT" ] && [ $it -lt 100 ];
do
it=$((it+1))
$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..250}; do
done
}
function thread_select()
{
local TIMELIMIT=$((SECONDS+$1))
local it=0
while [ $SECONDS -lt "$TIMELIMIT" ] && [ $it -lt 250 ];
do
it=$((it+1))
$CLICKHOUSE_CLIENT -q "select * from view_00840 order by table" >/dev/null 2>&1 || true
done &
done
}
export -f thread_drop_create
export -f thread_select
TIMEOUT=60
thread_drop_create $TIMEOUT &
thread_select $TIMEOUT &
wait
trap '' EXIT