Merge pull request #59041 from vitlibar/fix-test-02932_kill_query_sleep-2

Fix test 02932_kill_query_sleep when running with query cache
This commit is contained in:
Vitaly Baranov 2024-01-23 13:19:01 +01:00 committed by GitHub
commit 8e2fceb9b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ function wait_query_started()
local query_id="$1"
timeout=60
start=$EPOCHSECONDS
while [[ $($CLICKHOUSE_CLIENT --query="SELECT count() FROM system.processes WHERE query_id='$query_id'") == 0 ]]; do
while [[ $($CLICKHOUSE_CLIENT --query="SELECT count() FROM system.processes WHERE query_id='$query_id' SETTINGS use_query_cache=0") == 0 ]]; do
if ((EPOCHSECONDS-start > timeout )); then
echo "Timeout while waiting for query $query_id to start"
exit 1
@ -26,7 +26,7 @@ function kill_query()
$CLICKHOUSE_CLIENT --query "KILL QUERY WHERE query_id='$query_id'" >/dev/null
timeout=60
start=$EPOCHSECONDS
while [[ $($CLICKHOUSE_CLIENT --query="SELECT count() FROM system.processes WHERE query_id='$query_id'") != 0 ]]; do
while [[ $($CLICKHOUSE_CLIENT --query="SELECT count() FROM system.processes WHERE query_id='$query_id' SETTINGS use_query_cache=0") != 0 ]]; do
if ((EPOCHSECONDS-start > timeout )); then
echo "Timeout while waiting for query $query_id to cancel"
exit 1
@ -49,4 +49,4 @@ echo "Cancelling query"
kill_query "$sleep_query_id"
$CLICKHOUSE_CLIENT --query "SYSTEM FLUSH LOGS;"
$CLICKHOUSE_CLIENT --query "SELECT exception FROM system.query_log WHERE query_id='$sleep_query_id' AND current_database = currentDatabase()" | grep -oF "QUERY_WAS_CANCELLED"
$CLICKHOUSE_CLIENT --query "SELECT exception FROM system.query_log WHERE query_id='$sleep_query_id' AND current_database = '$CLICKHOUSE_DATABASE'" | grep -oF "QUERY_WAS_CANCELLED"