Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb496e3

Browse files
committed
Have vfork specific tests disable posix_spawn.
1 parent55790a1 commitcb496e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎Lib/test/test_subprocess.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,6 +3348,7 @@ def exit_handler():
33483348
@unittest.skipIf(notsysconfig.get_config_var("HAVE_VFORK"),
33493349
"vfork() not enabled by configure.")
33503350
@mock.patch("subprocess._fork_exec")
3351+
@mock.patch("subprocess._USE_POSIX_SPAWN",new=False)
33513352
deftest__use_vfork(self,mock_fork_exec):
33523353
self.assertTrue(subprocess._USE_VFORK)# The default value regardless.
33533354
mock_fork_exec.side_effect=RuntimeError("just testing args")
@@ -3366,9 +3367,13 @@ def test__use_vfork(self, mock_fork_exec):
33663367
@unittest.skipIf(notsysconfig.get_config_var("HAVE_VFORK"),
33673368
"vfork() not enabled by configure.")
33683369
@unittest.skipIf(sys.platform!="linux","Linux only, requires strace.")
3370+
@mock.patch("subprocess._USE_POSIX_SPAWN",new=False)
33693371
deftest_vfork_used_when_expected(self):
33703372
# This is a performance regression test to ensure we default to using
33713373
# vfork() when possible.
3374+
# Technically this test could pass when posix_spawn is used as well
3375+
# because libc tends to implement that internally using vfork. But
3376+
# that'd just be testing a libc+kernel implementation detail.
33723377
strace_binary="/usr/bin/strace"
33733378
# The only system calls we are interested in.
33743379
strace_filter="--trace=clone,clone2,clone3,fork,vfork,exit,exit_group"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp