@samitouri / QOSamiQemu / commits / 43e4791d99

iotests: run the test pool with the 'fork' start method

run_tests_pool() shares the runner via the class attribute TestRunner.shared_self, relying on worker processes to inherit it. That only works with the 'fork' start method. Python 3.14 switched the Linux default to 'forkserver', so workers see shared_self as None and parallel runs abort with: assert runner is not None AssertionError Only reproduces with Python 3.14+ and 'check -jN' (N > 1); meson runs one test per process and never calls run_tests_pool(), so CI is unaffected. Request get_context('fork') explicitly; it is available on all supported Python versions and a no-op before 3.14. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Kevin Wolf <kwolf@redhat.com> CC: Hanna Reitz <hreitz@redhat.com> Message-ID: <20260715103451.1930909-2-den@openvz.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Denis V. Lunev committed Jul 15, 2026 at 12:34 UTC 43e4791d99ab11c4bd12efaec061b3a43c8cde1c
1 file changed +2 -2
tests/qemu-iotests/testrunner.py
+2 -2
@@ -26,7 +26,7 @@ import contextlib
26 import json
27 import shutil
28 import sys
29 -from multiprocessing import Pool
29 +from multiprocessing import get_context
30 from typing import List, Optional, Any, Sequence, Dict
31 from testenv import TestEnv
32
@@ -125,7 +125,7 @@ class TestRunner(contextlib.AbstractContextManager['TestRunner']):
125 assert TestRunner.shared_self is None
126 TestRunner.shared_self = self
127
128 - with Pool(jobs) as p:
128 + with get_context('fork').Pool(jobs) as p:
129 results = p.starmap(self.proc_run_test,
130 zip(tests, [test_field_width] * len(tests)))
131