Add test for cancel_http_readonly_queries_on_client_close setting

This commit is contained in:
Nicolae Vartolomei 2019-02-04 13:10:23 +00:00
parent 8db13da097
commit 9d5d0a9200
No known key found for this signature in database
GPG Key ID: C8E7675B7C70A0E0
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}?query_id=cancel_http_readonly_queries_on_client_close&cancel_http_readonly_queries_on_client_close=1&query=SELECT+count()+FROM+system.numbers" &
REQUEST_CURL_PID=$!
sleep 0.1
# Check query is registered
$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query_id='cancel_http_readonly_queries_on_client_close'"
# Kill client (curl process)
kill -SIGTERM $REQUEST_CURL_PID
sleep 0.1
# Check query is killed after client is gone
$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query_id='cancel_http_readonly_queries_on_client_close'"