From 75789eb9a773330314e0a92a6369bb542fa62928 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 12 Apr 2022 20:18:27 +0300 Subject: [PATCH] tests: improve 02050_client_profile_events Signed-off-by: Azat Khuzhin --- .../0_stateless/02050_client_profile_events.reference | 4 ++++ .../0_stateless/02050_client_profile_events.sh | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/queries/0_stateless/02050_client_profile_events.reference b/tests/queries/0_stateless/02050_client_profile_events.reference index 2451417ddf0..e622780b7ec 100644 --- a/tests/queries/0_stateless/02050_client_profile_events.reference +++ b/tests/queries/0_stateless/02050_client_profile_events.reference @@ -1,5 +1,9 @@ +do not print any ProfileEvents packets 0 +print only last (and also number of rows to provide more info in case of failures) 100000 +print everything [ 0 ] SelectedRows: 131010 (increment) OK +print each 100 ms OK diff --git a/tests/queries/0_stateless/02050_client_profile_events.sh b/tests/queries/0_stateless/02050_client_profile_events.sh index f8bcea0d1bb..f0176f31c26 100755 --- a/tests/queries/0_stateless/02050_client_profile_events.sh +++ b/tests/queries/0_stateless/02050_client_profile_events.sh @@ -4,13 +4,16 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CURDIR"/../shell_config.sh -# do not print any ProfileEvents packets +echo 'do not print any ProfileEvents packets' $CLICKHOUSE_CLIENT -q 'select * from numbers(1e5) format Null' |& grep -c 'SelectedRows' -# print only last (and also number of rows to provide more info in case of failures) + +echo 'print only last (and also number of rows to provide more info in case of failures)' $CLICKHOUSE_CLIENT --max_block_size=65505 --print-profile-events --profile-events-delay-ms=-1 -q 'select * from numbers(1e5)' 2> >(grep -o -e '\[ 0 \] SelectedRows: .*$' -e Exception) 1> >(wc -l) -# print everything + +echo 'print everything' profile_events="$($CLICKHOUSE_CLIENT --max_block_size 1 --print-profile-events -q 'select sleep(1) from numbers(2) format Null' |& grep -c 'SelectedRows')" test "$profile_events" -gt 1 && echo OK || echo "FAIL ($profile_events)" -# print each 100 ms + +echo 'print each 100 ms' profile_events="$($CLICKHOUSE_CLIENT --max_block_size 1 --print-profile-events --profile-events-delay-ms=100 -q 'select sleep(1) from numbers(2) format Null' |& grep -c 'SelectedRows')" test "$profile_events" -gt 1 && echo OK || echo "FAIL ($profile_events)"