This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2017-08-09.00:35:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502238938.02.0.869596216729.issue31150@psf.upfronthosting.co.za>
In-reply-to
Content
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:

* test.test_thread.TestForkInThread.test_forkinthread
* test.test_thread.LockTests.test_acquire_contended

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)
History
Date User Action Args
2017-08-09 00:35:38vstinnersetrecipients: + vstinner
2017-08-09 00:35:38vstinnersetmessageid: <1502238938.02.0.869596216729.issue31150@psf.upfronthosting.co.za>
2017-08-09 00:35:37vstinnerlinkissue31150 messages
2017-08-09 00:35:36vstinnercreate