[conformance] Skip empty test cache error (#20924)

This commit is contained in:
Sofya Balandina
2023-11-08 15:50:49 +00:00
committed by Alexander Nesterov
parent 1c240d3719
commit d6f766413e

View File

@@ -332,14 +332,12 @@ class TestParallelRunner:
self._gtest_filter = "" self._gtest_filter = ""
self._command = self.__init_basic_command_line_for_exec_file(test_command_line) self._command = self.__init_basic_command_line_for_exec_file(test_command_line)
self._worker_num = worker_num self._worker_num = worker_num
if not os.path.exists(self._working_dir): os.makedirs(self._working_dir, exist_ok=True)
os.mkdir(self._working_dir) if cache_path == "" or not os.path.exists(cache_path):
if cache_path == "":
cache_path = os.path.join(self._working_dir, "test_cache.lst") cache_path = os.path.join(self._working_dir, "test_cache.lst")
self._cache_path = os.path.join(cache_path) self._cache_path = os.path.join(cache_path)
head, _ = os.path.split(self._cache_path) head, _ = os.path.split(self._cache_path)
if not os.path.exists(head): os.makedirs(head, exist_ok=True)
os.mkdir(head)
self._is_save_cache = True self._is_save_cache = True
if split_unit in constants.UNIT_NAMES: if split_unit in constants.UNIT_NAMES:
self._split_unit = split_unit self._split_unit = split_unit
@@ -875,7 +873,7 @@ class TestParallelRunner:
) )
if os.path.isfile(interapted_log_path): if os.path.isfile(interapted_log_path):
test_cnt_real_saved_now += 1 test_cnt_real_saved_now += 1
if self._is_save_cache: if self._is_save_cache and os.path.isfile(self._cache_path):
test_times.sort(reverse=True) test_times.sort(reverse=True)
with open(self._cache_path, "w", encoding=constants.ENCODING) as cache_file: with open(self._cache_path, "w", encoding=constants.ENCODING) as cache_file:
cache_file.writelines( cache_file.writelines(