un-flaky the test

This commit is contained in:
Yarik Briukhovetskyi 2024-04-26 20:31:26 +02:00 committed by GitHub
parent 0fd2d573ae
commit ebad7062a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,13 +5,16 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh # shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh . "$CUR_DIR"/../shell_config.sh
# Get the help message in short and vebose form and put them into txt files # Unique identifier for concurrent execution
$CLICKHOUSE_CLIENT --help > help_msg.txt PID=$$
$CLICKHOUSE_CLIENT --help --verbose > verbose_help_msg.txt
# Get the help message in short and verbose form and put them into txt files
$CLICKHOUSE_CLIENT --help > "help_msg_$PID.txt"
$CLICKHOUSE_CLIENT --help --verbose > "verbose_help_msg_$PID.txt"
# Sizes of files # Sizes of files
size_short=$(stat -c %s help_msg.txt) size_short=$(stat -c %s "help_msg_$PID.txt")
size_verbose=$(stat -c %s verbose_help_msg.txt) size_verbose=$(stat -c %s "verbose_help_msg_$PID.txt")
# If the size of the short help message is less, everything is OK # If the size of the short help message is less, everything is OK
if [ $size_short -lt $size_verbose ]; then if [ $size_short -lt $size_verbose ]; then
@ -20,16 +23,15 @@ else
echo "Not OK" echo "Not OK"
fi fi
rm help_msg.txt rm "help_msg_$PID.txt"
rm verbose_help_msg.txt rm "verbose_help_msg_$PID.txt"
# The same for clickhouse local # The same for clickhouse local
$CLICKHOUSE_LOCAL --help > help_msg.txt $CLICKHOUSE_LOCAL --help > "help_msg_$PID.txt"
$CLICKHOUSE_LOCAL --help --verbose > verbose_help_msg.txt $CLICKHOUSE_LOCAL --help --verbose > "verbose_help_msg_$PID.txt"
size_short=$(stat -c %s help_msg.txt) size_short=$(stat -c %s "help_msg_$PID.txt")
size_verbose=$(stat -c %s verbose_help_msg.txt) size_verbose=$(stat -c %s "verbose_help_msg_$PID.txt")
if [ $size_short -lt $size_verbose ]; then if [ $size_short -lt $size_verbose ]; then
echo "OK" echo "OK"
@ -37,5 +39,5 @@ else
echo "Not OK" echo "Not OK"
fi fi
rm help_msg.txt rm "help_msg_$PID.txt"
rm verbose_help_msg.txt rm "verbose_help_msg_$PID.txt"