Skip to content

bpo-41544: Add missing parameters to dummy.DummyProcess and dummy.Pool#21869

Open
moi90 wants to merge 7 commits intopython:mainfrom
moi90:patch-1
Open

bpo-41544: Add missing parameters to dummy.DummyProcess and dummy.Pool#21869
moi90 wants to merge 7 commits intopython:mainfrom
moi90:patch-1

Conversation

@moi90
Copy link
Copy Markdown
Contributor

@moi90 moi90 commented Aug 13, 2020

Add missing parameters to multiprocessing.dummy.DummyProcess in order to match the API of multiprocessing.Process.

https://bugs.python.org/issue41544

@the-knights-who-say-ni

This comment was marked as outdated.

@ZackerySpytz
Copy link
Copy Markdown
Contributor

This needs a unit test.

@moi90
Copy link
Copy Markdown
Contributor Author

moi90 commented Oct 10, 2020

It seems to me that there are not tests at all for DummyProcess. Is that right?
Any directions where to put them and how to get startet?

I'd appreciate any help with this.

@moi90
Copy link
Copy Markdown
Contributor Author

moi90 commented Nov 7, 2021

I added test_multiprocessing_dummy and it runs successfully. It shouldn't, however, because install_tests_in_module_dict calls multiprocessing.set_start_method("dummy") (in setUpModule) which should fail with a ValueError that is converted to a unittest.SkipTest. But the test is not skipped. Can someone explain this behavior?

EDIT: It seems that if setUpModule raises SkipTest, the file is displayed as "successful" by the test runner. Isn't that inaccurate?

In my eyes, to make use of the current test machinery, we need to make "dummy" a supported (but maybe undocumented) start method.

EDIT: I see why this doesn't work: The threading module requires a properly initialized multiprocessing context (which of cause can not be a threading-based dummy).

@moi90
Copy link
Copy Markdown
Contributor Author

moi90 commented Nov 7, 2021

I moved on to checking only the signatures. Also, I added the missing maxtasksperchild for dummy.Pool. Technically, this would be another pull request but I think it can be included here.

@moi90
Copy link
Copy Markdown
Contributor Author

moi90 commented Nov 12, 2021

@ZackerySpytz What do you think?

@applio, @pitrou Could you have a look?

@moi90 moi90 changed the title bpo-41544: Introduce daemon parameter to DummyProcess bpo-41544: Add missing parameters to DummyProcess Dec 2, 2021
@moi90 moi90 changed the title bpo-41544: Add missing parameters to DummyProcess bpo-41544: Add missing parameters to dummy.DummyProcess and dummy.Pool Dec 2, 2021
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Apr 8, 2026
@moi90
Copy link
Copy Markdown
Contributor Author

moi90 commented Apr 15, 2026

I rebased the changes onto main.

@ezio-melotti Why was the CLA signed label removed?

@ezio-melotti
Copy link
Copy Markdown
Member

@ezio-melotti Why was the CLA signed label removed?

The CLA is now handled by the "CLA Signing" check (which passes successfully).
@the-knights-who-say-ni and the labels are no longer used.

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

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants