MCPcopy Index your code
hub / github.com/python/cpython / wait_impl

Method wait_impl

Lib/test/test_wait4.py:18–32  ·  view source on GitHub ↗
(self, cpid, *, exitcode)

Source from the content-addressed store, hash-verified

16
17class Wait4Test(ForkWait):
18 def wait_impl(self, cpid, *, exitcode):
19 option = os.WNOHANG
20 if sys.platform.startswith('aix'):
21 # Issue #11185: wait4 is broken on AIX and will always return 0
22 # with WNOHANG.
23 option = 0
24 for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
25 # wait4() shouldn't hang, but some of the buildbots seem to hang
26 # in the forking tests. This is an attempt to fix the problem.
27 spid, status, rusage = os.wait4(cpid, option)
28 if spid == cpid:
29 break
30 self.assertEqual(spid, cpid)
31 self.assertEqual(os.waitstatus_to_exitcode(status), exitcode)
32 self.assertTrue(rusage)
33
34def tearDownModule():
35 support.reap_children()

Callers

nothing calls this directly

Calls 3

assertTrueMethod · 0.80
startswithMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected