1 """This test checks for correct wait3() behavior.
7 from test
.fork_wait
import ForkWait
8 from test
.test_support
import run_unittest
, reap_children
12 except AttributeError:
13 raise unittest
.SkipTest
, "os.fork not defined -- skipping test_wait3"
17 except AttributeError:
18 raise unittest
.SkipTest
, "os.wait3 not defined -- skipping test_wait3"
20 class Wait3Test(ForkWait
):
21 def wait_impl(self
, cpid
):
23 # wait3() shouldn't hang, but some of the buildbots seem to hang
24 # in the forking tests. This is an attempt to fix the problem.
25 spid
, status
, rusage
= os
.wait3(os
.WNOHANG
)
30 self
.assertEqual(spid
, cpid
)
31 self
.assertEqual(status
, 0, "cause = %d, exit = %d" % (status
&0xff, status
>>8))
32 self
.assertTrue(rusage
)
35 run_unittest(Wait3Test
)
38 if __name__
== "__main__":