Message303762
A colleague packaging Python for Red Hat Entreprise Linux reported me that tests hang randomly on test_exception_errpipe_bad_data() of test_subprocess. I don't know why exactly, but using strace, I noticed that the "unit test" calls os.waitpid() with the pid returned by the mocked fork_exec(): pid 0. So the test calls os.waitpid(0, 0).
In a REPL on my Fedora 26, os.waitpid(0, 0) raises "ChildProcessError: [Errno 10] No child processes". I'm not sure that waitpid() is the cause of the hang, but it doesn't seem correct to me to call waitpid() with the result of a mock function, since the mock doesn't create a real child process.
Attached PR 3896 mocks also os.waitpid() to fix this bug. I reopen the issue to discuss this bug in the new test added in this issue. |
|
Date |
User |
Action |
Args |
2017-10-05 13:12:25 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, ammar2 |
2017-10-05 13:12:25 | vstinner | set | messageid: <1507209145.37.0.213398074469.issue31178@psf.upfronthosting.co.za> |
2017-10-05 13:12:25 | vstinner | link | issue31178 messages |
2017-10-05 13:12:25 | vstinner | create | |
|