Skip to content

Commit 0c503c2

Browse files
committed
Issue python#11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé.
1 parent e38905b commit 0c503c2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎Lib/test/test_wait4.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import os
55
import time
6+
import sys
67
from test.fork_wait import ForkWait
78
from test.test_support import run_unittest, reap_children, get_attribute
89

@@ -13,10 +14,15 @@
1314

1415
class Wait4Test(ForkWait):
1516
def wait_impl(self, cpid):
17+
option = os.WNOHANG
18+
if sys.platform.startswith('aix'):
19+
# Issue #11185: wait4 is broken on AIX and will always return 0
20+
# with WNOHANG.
21+
option = 0
1622
for i in range(10):
1723
# wait4() shouldn't hang, but some of the buildbots seem to hang
1824
# in the forking tests. This is an attempt to fix the problem.
19-
spid, status, rusage = os.wait4(cpid, os.WNOHANG)
25+
spid, status, rusage = os.wait4(cpid, option)
2026
if spid == cpid:
2127
break
2228
time.sleep(1.0)

‎Misc/NEWS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ IDLE
9999
Tests
100100
-----
101101

102+
- Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé.
103+
102104
- Issue #18094: test_uuid no more reports skipped tests as passed.
103105

104106
- Issue #11995: test_pydoc doesn't import all sys.path modules anymore.

0 commit comments

Comments
 (0)