From ba61160d6c6a69104aa0f68370139d745af11484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alicia=20Boya=20Garc=C3=ADa?= Date: Fri, 11 Aug 2023 18:30:41 +0200 Subject: [PATCH] validate-launcher: Fix race condition on repeated tests Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2900 The `reports` list was being copied as a reference, therefore, copies of a test ended up inadvertedly sharing the same list of reports. Reports added by one instance of the test would be reflected in all instances. This caused a race condition where, if a test was run on repeat with gst-validate-launcher -f, very often wrong log file was shown to the user. For instance, gst-validate-launcher would say "test failed, see log for iteration7", but iteration7 would contain "TEST PASSED". Worse, the runner would add the report to that incorrect log file, mixing problems between different executions of the tests. Part-of: --- subprojects/gst-devtools/validate/launcher/baseclasses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-devtools/validate/launcher/baseclasses.py b/subprojects/gst-devtools/validate/launcher/baseclasses.py index 59034dab5b..886efa0e4a 100644 --- a/subprojects/gst-devtools/validate/launcher/baseclasses.py +++ b/subprojects/gst-devtools/validate/launcher/baseclasses.py @@ -163,6 +163,7 @@ class Test(Loggable): def copy(self, nth=None): copied_test = copy.copy(self) + copied_test.reports = copy.deepcopy(self.reports) if nth: copied_test.classname += '_it' + str(nth) copied_test._uuid = None