You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EASY] test_thread: Warning -- reap_children() reaped child process #75333
New changeset 88eee44 by Victor Stinner (Ammar Askar) in branch 'master': bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3032) 88eee44
New changeset 425680b by Victor Stinner (Ammar Askar) in branch '2.7':
[2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3042) 425680b
New changeset 4388b42 by Victor Stinner (Ammar Askar) in branch '3.6':
[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3041) 4388b42
Activity
vstinner commentedon Aug 9, 2017
It seems like an unit test of test_thread leaks a process. A bisection found the following 2 tests are enough to get the warning:
I bet that test_forkinthread() doesn't wait correctly for the child process (fork) completion using os.waitpid() or something like that.
Example 1 (from Refleak buildbot):
haypo@selma$ ./python -m test -R 3:3 test_thread
Run tests sequentially
0:00:00 load avg: 0.55 [1/1] test_thread
beginning 6 repetitions
123456
Warning -- reap_children() reaped child process 6984
.Warning -- reap_children() reaped child process 7054
.Warning -- reap_children() reaped child process 7125
.Warning -- reap_children() reaped child process 7195
.Warning -- reap_children() reaped child process 7266
.Warning -- reap_children() reaped child process 7336
.
1 test OK.
Total duration: 5 sec
Tests result: SUCCESS
Example 2 (only run the 2 methods):
haypo@selma$ ./python -m test -m test.test_thread.TestForkInThread.test_forkinthread -m test.test_thread.LockTests.test_acquire_contended -v test_thread test_thread
0:00:00 load avg: 0.27 [1/2] test_thread
test_acquire_contended (test.test_thread.LockTests) ... ok
test_forkinthread (test.test_thread.TestForkInThread) ... ok
----------------------------------------------------------------------
Ran 2 tests in 0.037s
OK
0:00:00 load avg: 0.27 [2/2] test_thread
test_acquire_contended (test.test_thread.LockTests) ... Warning -- reap_children() reaped child process 10613
ok
test_forkinthread (test.test_thread.TestForkInThread) ... ok
----------------------------------------------------------------------
Ran 2 tests in 0.036s
OK
test_thread failed (env changed)
vstinner commentedon Aug 9, 2017
New changeset 88eee44 by Victor Stinner (Ammar Askar) in branch 'master':
bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3032)
88eee44
vstinner commentedon Aug 9, 2017
New changeset 425680b by Victor Stinner (Ammar Askar) in branch '2.7':
[2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3042)
425680b
vstinner commentedon Aug 9, 2017
New changeset 4388b42 by Victor Stinner (Ammar Askar) in branch '3.6':
[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (bpo-3041)
4388b42
vstinner commentedon Aug 9, 2017
Thank you Ammar Askar for your contribution!