Issue 31150: [EASY] test_thread: Warning -- reap_children() reaped child process (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/75333

classification

Title: [EASY] test_thread: Warning -- reap_children() reaped child process
Type: Stage: resolved
Components: Versions: Python 3.7, Python 3.6, Python 2.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: easy

Created on 2017-08-09 00:35 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3032 merged ammar2,2017-08-09 04:37
PR 3041 merged ammar2,2017-08-09 14:29
PR 3042 merged ammar2,2017-08-09 14:38
Messages (5)
msg299958 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-08-09 00:35
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)
msg299978 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-08-09 08:51
New changeset 88eee44a91c991dbbdf284fa220e2928b5de105c by Victor Stinner (Ammar Askar) in branch 'master': bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3032) https://github.com/python/cpython/commit/88eee44a91c991dbbdf284fa220e2928b5de105c
msg300013 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-08-09 14:54
New changeset 425680bbd2dc14ef8dc5d1928f44fc7cc43018c4 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 (#3042) https://github.com/python/cpython/commit/425680bbd2dc14ef8dc5d1928f44fc7cc43018c4
msg300014 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-08-09 14:59
New changeset 4388b4257abf3b9c348cf4db8c6144dcc07f3e98 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 (#3041) https://github.com/python/cpython/commit/4388b4257abf3b9c348cf4db8c6144dcc07f3e98
msg300015 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-08-09 14:59
Thank you Ammar Askar for your contribution!
History
Date User Action Args
2022-04-11 14:58:49 admin set github: 75333
2017-08-09 14:59:51 vstinner set status: open -> closedresolution: fixedmessages: + stage: resolved
2017-08-09 14:59:24 vstinner set messages: +
2017-08-09 14:54:56 vstinner set messages: +
2017-08-09 14:38:19 ammar2 set pull_requests: + <pull%5Frequest3076>
2017-08-09 14:29:44 ammar2 set pull_requests: + <pull%5Frequest3075>
2017-08-09 08:58:41 vstinner set versions: + Python 2.7
2017-08-09 08:51:45 vstinner set messages: +
2017-08-09 04:37:42 ammar2 set pull_requests: + <pull%5Frequest3067>
2017-08-09 00:35:38 vstinner create