[6.x] Avoid deadlock in test when sharing process group #32067
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The testSharedGet test spawns child processes and waits for them to
exit. The main process will wait for all child processes in its own
process group.
While this usually works, the processes involved in the test case are
not necessarily the only processes in their process group. Should
PHPUnit itself be executing in a child process, its parent process
will also be there, causing a deadlock.
This change will move the main test process into its own process group
before forking to avoid the aforementioned situation.