Skip to content

gh-133744: Fix multiprocessing interrupt test: add an event #133746

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 9, 2025

Add an event to synchronize the parent process with the child process: wait until the child process starts sleeping.

Add an event to synchronize the parent process with the child
process: wait until the child process starts sleeping.
@vstinner vstinner added tests Tests in the Lib/test dir topic-multiprocessing labels May 9, 2025
@vstinner vstinner marked this pull request as ready for review May 9, 2025 12:56
@vstinner vstinner requested a review from gpshead as a code owner May 9, 2025 12:56
@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

cc @gpshead @colesbury @pitrou

Without this change, the SIGINT signal can be sent too early: in multiprocessing setup code.

@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

With this change, I can no longer reproduce the issue:

$ ./python -m test test_multiprocessing_spawn.test_processes -m test_interrupt_no_handler -m test_interrupt -m test_terminate -m test_kill  -W -F -j14
...
0:02:04 load avg: 17.62 [180] test_multiprocessing_spawn.test_processes passed
0:02:04 load avg: 18.13 [181] test_multiprocessing_spawn.test_processes passed
0:02:06 load avg: 18.13 [182] test_multiprocessing_spawn.test_processes passed

@vstinner
Copy link
Member Author

vstinner commented May 9, 2025

Since 2013, there was a workaround for this issue, using a simple sleep(1): commit 26f9268.

        # XXX maybe terminating too soon causes the problems on Gentoo...
        time.sleep(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant