mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Made test for KILL QUERY more deterministic. [#CLICKHOUSE-2120] [resloved #283]
This commit is contained in:
parent
ff54b9466d
commit
7f73f91705
@ -1,6 +1,6 @@
|
||||
SELECT sleep(1) FROM system.numbers LIMIT 6
|
||||
SELECT sleep(2) FROM system.numbers LIMIT 3
|
||||
SELECT sleep(3) FROM system.numbers LIMIT 2
|
||||
SELECT sleep(2) FROM system.numbers LIMIT 4
|
||||
SELECT sleep(3) FROM system.numbers LIMIT 3
|
||||
SELECT sleep(4) FROM system.numbers LIMIT 2
|
||||
0
|
||||
SELECT sleep(1) FROM system.numbers LIMIT 999
|
||||
0
|
||||
|
@ -3,12 +3,12 @@ set -e
|
||||
|
||||
QUERY_FIELND_NUM=4
|
||||
|
||||
# should be quite deterministic
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(3) FROM system.numbers LIMIT 2" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(1) FROM system.numbers LIMIT 6" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(2) FROM system.numbers LIMIT 3" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT 'trash', sleep(2) FROM system.numbers LIMIT 3" &>/dev/null &
|
||||
sleep 1 # wait initialization
|
||||
# Sleep sort. Should be quite deterministic
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(4) FROM system.numbers LIMIT 2" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(2) FROM system.numbers LIMIT 4" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT sleep(3) FROM system.numbers LIMIT 3" &>/dev/null &
|
||||
clickhouse-client --max_block_size=1 -q "SELECT 'trash', sleep(2) FROM system.numbers LIMIT 4" &>/dev/null &
|
||||
sleep 1 # here we need wait 1 sec for init, therefore minimum "sorting element" should be greater than 1 sec (i.e. 2 sec)
|
||||
clickhouse-client -q "KILL QUERY WHERE query LIKE 'SELECT sleep(%' AND (elapsed >= 0.) SYNC" | cut -f $QUERY_FIELND_NUM
|
||||
clickhouse-client -q "SELECT countIf(query LIKE 'SELECT sleep(%') FROM system.processes"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user