mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Add max time limit to 00840_long_concurrent_select_and_drop_deadlock
This commit is contained in:
parent
4d63bc24a5
commit
bf3762db20
@ -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
|
||||
$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
|
||||
$CLICKHOUSE_CLIENT -q "select * from view_00840 order by table" >/dev/null 2>&1 || true
|
||||
done &
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
export -f thread_drop_create
|
||||
export -f thread_select
|
||||
|
||||
TIMEOUT=60
|
||||
thread_drop_create $TIMEOUT &
|
||||
thread_select $TIMEOUT &
|
||||
|
||||
wait
|
||||
trap '' EXIT
|
||||
|
Loading…
Reference in New Issue
Block a user