diff --git a/tests/queries/0_stateless/01945_show_debug_warning.expect b/tests/queries/0_stateless/01945_show_debug_warning.expect index b5b5cde2f49..4e324a65d93 100755 --- a/tests/queries/0_stateless/01945_show_debug_warning.expect +++ b/tests/queries/0_stateless/01945_show_debug_warning.expect @@ -15,8 +15,28 @@ expect_after { } set basedir [file dirname $argv0] +set Debug_type 0 + spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion" -]expect "Warnings:" +expect ":) " + +# Check debug type +send -- "SELECT value FROM system.build_options WHERE name='BUILD_TYPE'\r" +expect { +"Debug" { + set Debug_type 1 + expect ":) " + } +"RelWithDebInfo" +} + +send -- "\4" +expect eof + +if { $Debug_type > 0} { + +spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion" +expect "Warnings:" expect " * Server was built in debug mode. It will work slowly." expect ":) " @@ -26,4 +46,5 @@ expect "Server was built in debug mode. It will work slowly." expect ":) " send -- "\4" -expect eof \ No newline at end of file +expect eof +} diff --git a/tests/queries/0_stateless/01945_show_warnings.sh b/tests/queries/0_stateless/01945_show_warnings.sh deleted file mode 100755 index 6178fb7073d..00000000000 --- a/tests/queries/0_stateless/01945_show_warnings.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -# shellcheck source=../shell_config.sh -. "$CURDIR"/../shell_config.sh - -BUILD_TYPE=$("${CLICKHOUSE_CLIENT}" --multiquery --query "SELECT value FROM system.build_options WHERE name='BUILD_TYPE'") - -if [ $BUILD_TYPE == "Debug" ] -then ./01945_show_debug_warning.expect -fi \ No newline at end of file