From e9dc2cbcf70968996a1afbae3c409c5177f77f74 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 19 May 2020 01:12:51 +0300 Subject: [PATCH] Add missing SYSTEM FLUSH LOGS before TRUNCATE TABLE in clickhouse-test Suggested-by: @filimonov --- tests/clickhouse-test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/clickhouse-test b/tests/clickhouse-test index 76a61e1d558..324fd13aac2 100755 --- a/tests/clickhouse-test +++ b/tests/clickhouse-test @@ -235,6 +235,9 @@ def run_tests_array(all_tests_with_params): clickhouse_proc.communicate("SELECT 'Running test {suite}/{case} from pid={pid}';".format(pid = os.getpid(), case = case, suite = suite)) if not args.no_system_log_cleanup: + clickhouse_proc = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE) + clickhouse_proc.communicate("SYSTEM FLUSH LOGS") + for table in ['query_log', 'query_thread_log', 'trace_log', 'metric_log']: clickhouse_proc = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE) clickhouse_proc.communicate("TRUNCATE TABLE IF EXISTS system.{}".format(table))