Repository navigation
AssertionError in test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt #133651
Copy link
Copy link
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I try to build Python 3.14.0b1 on Fedora Linux 42, 41, 40, the test has failed so far (the list is incomplete) for debug and freethreading-debug builds, on x86_64, i686, aarch64 arches. Traceback is in all cases similar with the difference of pipe_handle argument value.
Re-running test.test_multiprocessing_spawn.test_processes in verbose mode (matching: test_interrupt)
test_interrupt (test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt) ... Traceback (most recent call last):
File "<string>", line 1, in <module>
from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 122, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 131, in _main
prepare(preparation_data)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 244, in prepare
_fixup_main_from_name(data['init_main_from_name'])
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 268, in _fixup_main_from_name
main_content = runpy.run_module(mod_name,
run_name="__mp_main__",
alter_sys=True)
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 226, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 98, in _run_module_code
_run_code(code, mod_globals, init_globals,
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mod_name, mod_spec, pkg_name, script_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 88, in _run_code
exec(code, run_globals)
~~~~^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/worker.py", line 8, in <module>
from .setup import setup_process, setup_test_dir
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/setup.py", line 12, in <module>
from .runtests import RunTests
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/runtests.py", line 194, in <module>
@dataclasses.dataclass(slots=True, frozen=True)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 1362, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
frozen, match_args, kw_only, slots,
weakref_slot)
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 1163, in _process_class
func_builder.add_fns_to_class(cls)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 507, in add_fns_to_class
fns = ns['__create_fn__'](**self.locals)
File "<string>", line 28, in __create_fn__
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/reprlib.py", line 32, in decorating_function
wrapper.__type_params__ = getattr(user_function, '__type_params__', ())
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
FAIL
======================================================================
FAIL: test_interrupt (test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/_test_multiprocessing.py", line 578, in test_interrupt
self.assertEqual(exitcode, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
AssertionError: -2 != 1
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
befeleme commentedon May 8, 2025
Upon repeated builds it looks there's more:
test.test_multiprocessing_forkserver.test_processes.WithProcessesTestProcess.test_interrupt_no_handlerfailed on Fedora 41 on ppcle64.Both test_multiprocessing_forkserver and test_multiprocessing_spawn tend to fail on our CI where we test installed debug Python version.
python3: ptest: skip flaky test_interrupt on musl
python3: ptest: skip flaky test_interrupt on musl
vstinner commentedon Oct 14, 2026
I saw test_interrupt() failed a few times last days.
Example on AMD64 Fedora Stable Refleaks 3.x: https://buildbot.python.org/#/builders/320/builds/4698
vstinner commentedon Oct 22, 2026
Another failure on s390x RHEL9 Refleaks 3.x: https://buildbot.python.org/#/builders/1589/builds/4081
pythongh-133651: Increase multiprocessing test_interrupt() timeout
vstinner commentedon Oct 22, 2026
test_interrupt() uses an hardcoded timeout of 10 seconds. I wrote #160281 to reuse support.SHORT_TIMEOUT which is 30 seconds by default, but SHORT_TIMEOUT is increased if TIMEOUT of
python -m test --timeout=TIMEOUTis longer than 20 minutes. So if you're still impacted after my change is merged, use--timeoutwith a timeout of at least 30 minutes.vstinner commentedon Oct 22, 2026
test_interrupt_no_handler():
For this test failure, I have no clue. Maybe increasing the timeout will kill test_interrupt_no_handler() too, since it uses the same code.
gh-133651: Increase multiprocessing test_interrupt() timeout (#160281)
vstinner commentedon Oct 22, 2026
Ok, I increased the timeout in the main branch. Backports to 3.14 and 3.15 will follow (once CI pass on my PRs). I close the issue. Reopen the issue or open a new issue if you hit this issue again.
If you hit this issue again, please explain in your bug report how you run the test suite, the number of CPUs, and if your system is idle or busy.
vstinner commentedon Oct 22, 2026
@befeleme: Sorry, this took longer than expected to fix this test failure :-)
[3.15] gh-133651: Increase multiprocessing test_interrupt() timeout (G…
[3.14] gh-133651: Increase multiprocessing test_interrupt() timeout (G…