Commit 43e4791d99 for qemu.org
commit 43e4791d99ab11c4bd12efaec061b3a43c8cde1c
Author: Denis V. Lunev <den@openvz.org>
Date: Wed Jul 15 12:34:49 2026 +0200
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>
diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index dbe2dddc32..cc36867719 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -26,7 +26,7 @@
import json
import shutil
import sys
-from multiprocessing import Pool
+from multiprocessing import get_context
from typing import List, Optional, Any, Sequence, Dict
from testenv import TestEnv
@@ -125,7 +125,7 @@ def run_tests_pool(self, tests: List[str],
assert TestRunner.shared_self is None
TestRunner.shared_self = self
- with Pool(jobs) as p:
+ with get_context('fork').Pool(jobs) as p:
results = p.starmap(self.proc_run_test,
zip(tests, [test_field_width] * len(tests)))