python / python/cpython

AssertionError in test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt

Open
#133,651 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tests topic-multiprocessing type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt in Lib/test/_test_multiprocessing.py and reproduce it on the affected Linux debug or freethreading-debug build. Trace the spawned process through Lib/multiprocessing/spawn.py and the dataclass path in Lib/test/libregrtest/runtests.py and Lib/reprlib.py; done means the test completes with the intended exit code across the reported configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.