From 946314cc26cfb8a6010d77b11ded51da40efd91b Mon Sep 17 00:00:00 2001 From: Matistjati Date: Mon, 2 Mar 2026 22:20:18 +0100 Subject: [PATCH] Fix multithreaded symlink crash --- problemtools/verifyproblem.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/problemtools/verifyproblem.py b/problemtools/verifyproblem.py index ccd09ef8..e8909c1c 100644 --- a/problemtools/verifyproblem.py +++ b/problemtools/verifyproblem.py @@ -1730,10 +1730,12 @@ def _gather_testcases(self, item: TestCase | TestCaseGroup) -> list[TestCase]: if not item.matches_filter(self._context.data_filter): return [] if isinstance(item, TestCase): - if item.reuse_result_from: - return self._gather_testcases(item.reuse_result_from) - else: - return [item] + # If testcase is symlink, recursively follow the symlinks until we get a real testcase, ignoring + # whether the name of testcases pointed to matches the filter + while item.reuse_result_from: + item = item.reuse_result_from + + return [item] elif item not in self._done_groups: ret = [] for child in item.get_testcases() + item.get_subgroups():