From 21082be9a681166b5585445c8aed62e705063081 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 16 Jan 2024 10:41:13 +0100 Subject: [PATCH] Better test --- tests/clickhouse-test | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/clickhouse-test b/tests/clickhouse-test index dd9047c293f..6d398115d43 100755 --- a/tests/clickhouse-test +++ b/tests/clickhouse-test @@ -1269,13 +1269,17 @@ class TestCase: file_pattern = "coverage.*" matching_files = glob.glob(file_pattern) for file_path in matching_files: - body = read_file_as_binary_string(file_path) - clickhouse_execute( - args, - f"INSERT INTO system.coverage_log SELECT now(), '{self.case}', groupArray(data) FROM input('data UInt64') FORMAT RowBinary", - body=body, - retry_error_codes=True, - ) + try: + body = read_file_as_binary_string(file_path) + clickhouse_execute( + args, + f"INSERT INTO system.coverage_log SELECT now(), '{self.case}', groupArray(data) FROM input('data UInt64') FORMAT RowBinary", + body=body, + retry_error_codes=True, + ) + except Exception as e: + print("Cannot insert coverage data: ", str(e)) + # Remove the file even in case of exception to avoid accumulation and quadratic complexity. os.remove(file_path) coverage = clickhouse_execute(