11#! /usr/bin/env bash
2+ # Tags: no-fasttest
3+ # Tag no-fasttest: this test relies on the timeouts, it always takes no less that 4 seconds to run
24
35CURDIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
46# shellcheck source=../shell_config.sh
@@ -12,11 +14,12 @@ errors_111=$($CLICKHOUSE_CLIENT -q "SELECT sum(value) FROM system.error_log WHER
1214errors_222=$( $CLICKHOUSE_CLIENT -q " SELECT sum(value) FROM system.error_log WHERE code = 222" )
1315errors_333=$( $CLICKHOUSE_CLIENT -q " SELECT sum(value) FROM system.error_log WHERE code = 333" )
1416
15- # Throw three random errors: 111, 222 and 333 and call flush logs to ensure system.error_log is flushed
17+ # Throw three random errors: 111, 222 and 333 and wait for more than collect_interval_milliseconds to ensure system.error_log is flushed
1618$CLICKHOUSE_CLIENT -mn -q "
1719SELECT throwIf(true, 'error_log', toInt16(111)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 111 }
1820SELECT throwIf(true, 'error_log', toInt16(222)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 222 }
1921SELECT throwIf(true, 'error_log', toInt16(333)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 333 }
22+ SELECT sleep(2) format NULL;
2023SYSTEM FLUSH LOGS;
2124"
2225
@@ -32,6 +35,7 @@ $CLICKHOUSE_CLIENT -mn -q "
3235SELECT throwIf(true, 'error_log', toInt16(111)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 111 }
3336SELECT throwIf(true, 'error_log', toInt16(222)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 222 }
3437SELECT throwIf(true, 'error_log', toInt16(333)) SETTINGS allow_custom_error_code_in_throwif=1; -- { serverError 333 }
38+ SELECT sleep(2) format NULL;
3539SYSTEM FLUSH LOGS;
3640"
3741
0 commit comments