mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5177>
This commit is contained in:
parent
4abe4b2d2a
commit
ba61160d6c
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue