Add missing SYSTEM FLUSH LOGS before TRUNCATE TABLE in clickhouse-test

Suggested-by: @filimonov
This commit is contained in:
Azat Khuzhin 2020-05-19 01:12:51 +03:00
parent bd86f15680
commit e9dc2cbcf7

View File

@ -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))