From: Kevin Wolf <kwolf@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
Hanna Reitz <hreitz@redhat.com>
Subject: Re: [PATCH 1/3] iotests: run the test pool with the 'fork' start method
Date: Tue, 14 Jul 2026 13:08:53 +0200 [thread overview]
Message-ID: <alYYxYcpZEm6qN1M@redhat.com> (raw)
In-Reply-To: <20260710161309.1104712-2-den@openvz.org>
Am 10.07.2026 um 18:13 hat Denis V. Lunev geschrieben:
> 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>
> ---
> tests/qemu-iotests/testrunner.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
> index dbe2dddc32..5b2664d9f3 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 Pool, 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)))
Makes sense, but the Pool import is now unused:
=== pylint ===
+************* Module testrunner
+testrunner.py:29:0: W0611: Unused Pool imported from multiprocessing (unused-import)
=== mypy ===
Kevin
next prev parent reply other threads:[~2026-07-14 11:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 16:13 [PATCH 0/3] iotests: fix three spurious local failures Denis V. Lunev
2026-07-10 16:13 ` [PATCH 1/3] iotests: run the test pool with the 'fork' start method Denis V. Lunev
2026-07-14 11:08 ` Kevin Wolf [this message]
2026-07-10 16:13 ` [PATCH 2/3] iotests: skip FUSE tests when FUSE is not usable Denis V. Lunev
2026-07-14 11:19 ` Kevin Wolf
2026-07-10 16:13 ` [PATCH 3/3] iotests/migrate-bitmaps-postcopy-test: drop the postcopy timing assertion Denis V. Lunev
2026-07-14 11:28 ` Kevin Wolf
2026-07-14 12:36 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alYYxYcpZEm6qN1M@redhat.com \
--to=kwolf@redhat.com \
--cc=den@openvz.org \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.