Skip to content

test_multiprocessing_spawn: test_interrupt() fails randomly #133744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vstinner opened this issue May 9, 2025 · 1 comment
Open

test_multiprocessing_spawn: test_interrupt() fails randomly #133744

vstinner opened this issue May 9, 2025 · 1 comment
Labels
tests Tests in the Lib/test dir topic-multiprocessing

Comments

@vstinner
Copy link
Member

vstinner commented May 9, 2025

On a Free Threading build when tests are run in parallel (-F -j14) to stress the test:

vstinner@mona$ /opt/py314b1-ft/bin/python3.14td -m test test_multiprocessing_spawn.test_processes -W -m test_interrupt -F -j14
Using random seed: 1851856330
0:00:00 load avg: 1.58 Run tests in parallel using 14 worker processes
0:00:03 load avg: 1.58 [  1/1] test_multiprocessing_spawn.test_processes failed (1 failure)
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 "/opt/py314b1-ft/lib/python3.14t/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/opt/py314b1-ft/lib/python3.14t/multiprocessing/spawn.py", line 132, in _main
    self = reduction.pickle.load(from_parent)
  File "/opt/py314b1-ft/lib/python3.14t/test/test_multiprocessing_spawn/test_processes.py", line 2, in <module>
    from test._test_multiprocessing import install_tests_in_module_dict
  File "/opt/py314b1-ft/lib/python3.14t/test/_test_multiprocessing.py", line 53, in <module>
    import multiprocessing.managers
  File "/opt/py314b1-ft/lib/python3.14t/multiprocessing/managers.py", line 32, in <module>
    from . import pool
  File "<frozen importlib._bootstrap>", line 1371, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1342, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 938, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 758, in exec_module
  File "<frozen importlib._bootstrap_external>", line 891, in get_code
  File "<frozen importlib._bootstrap_external>", line 516, in _compile_bytecode
  File "<frozen importlib._bootstrap>", line 494, in _verbose_message
KeyboardInterrupt
FAIL

======================================================================
FAIL: test_interrupt (test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/py314b1-ft/lib/python3.14t/test/_test_multiprocessing.py", line 578, in test_interrupt
    self.assertEqual(exitcode, 1)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
AssertionError: -2 != 1

Python installed from the Python-3.14.0b1 tarball with:

$ ./configure --disable-gil --prefix /opt/py314b1-ft --with-pydebug
$ make
$ make install

Linked PRs

@vstinner vstinner added tests Tests in the Lib/test dir topic-multiprocessing labels May 9, 2025
vstinner added a commit to vstinner/cpython that referenced this issue May 9, 2025
Add an event to synchronize the parent process with the child
process: wait until the child process starts sleeping.
@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

The SIGINT was received in early multiprocessing setup code:

  File "/opt/py314b1-ft/lib/python3.14t/multiprocessing/managers.py", line 32, in <module>
    from . import pool

I propose #133746 to fix the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-multiprocessing
Projects
None yet
Development

No branches or pull requests

1 participant