classification
Title: warning of threading_cleanup in test_threading
Type: Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, xiang.zhang
Priority: normal Keywords:

Created on 2017-05-17 15:01 by xiang.zhang, last changed 2017-05-17 22:39 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1634 merged vstinner, 2017-05-17 18:41
PR 1636 merged vstinner, 2017-05-17 19:00
PR 1637 merged vstinner, 2017-05-17 19:01
Messages (10)
msg293857 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-05-17 15:01
Running test_threading throws a warning now.

./python -m test test_threading
Run tests sequentially
0:00:00 load avg: 0.22 [1/1] test_threading
Warning -- threading_cleanup() failed to cleanup 0 threads after 2 sec (count: 0, dangling: 21)
1 test OK.

Total duration: 13 sec
Tests result: SUCCESS

Seems related to 79ef7f8e88a4972c4aecf95cfc5cd934f1861e08.
msg293867 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 18:27
What is your OS? On which Python version?
msg293868 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 18:29
> Seems related to 79ef7f8e88a4972c4aecf95cfc5cd934f1861e08.

That's bpo-30357.

It's just that before test_threaindg "leaked" tests but there was no warning. Getting a warning is a good thing, it means that we have a bug that it must be fixed ;-)
msg293869 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 18:34
Oh wait, I succeeded to reproduce the bug on master. In verbose mode, we even get the test name!

test_is_alive_after_fork (test.test_threading.ThreadTests) ... Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 21)
ok
msg293871 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 18:42
https://github.com/python/cpython/pull/1634 fixes the 
test_is_alive_after_fork() warning on Linux.
msg293875 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 18:58
New changeset f8d05b3a24e745ab4a974b891ac1389e2f11ce4d by Victor Stinner in branch 'master':
bpo-30387: Fix warning in test_threading (#1634)
https://github.com/python/cpython/commit/f8d05b3a24e745ab4a974b891ac1389e2f11ce4d
msg293878 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 19:04
Oh, strange, the test in Python 2.7 doesn't have the bug: see commit 30a5445b30bb627a64b2d30788f6db58f6db3ae1. Compare it to the code in Python 3: commit 9939cc89a4ee54ab50719a597a8b8a0795a691f6.

The warning is already fixed in master. I created backports for 3.5 and 3.6.
msg293890 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 21:49
New changeset 44944b602af23712d7119801183cdc6e202e4f76 by Victor Stinner in branch '3.6':
bpo-30387: Fix warning in test_threading (#1634) (#1636)
https://github.com/python/cpython/commit/44944b602af23712d7119801183cdc6e202e4f76
msg293892 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 21:49
New changeset f5633e02433a81a6d0f14fc1c3294e752f4ac1a3 by Victor Stinner in branch '3.5':
bpo-30387: Fix warning in test_threading (#1634) (#1637)
https://github.com/python/cpython/commit/f5633e02433a81a6d0f14fc1c3294e752f4ac1a3
msg293900 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-17 22:39
Ok, the warning should now be fixed. Thanks for the report Xiang. I don't know how I missed it ;-)
History
Date User Action Args
2017-05-17 22:39:17vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg293900

stage: resolved
2017-05-17 21:49:45vstinnersetmessages: + msg293892
2017-05-17 21:49:40vstinnersetmessages: + msg293890
2017-05-17 19:04:09vstinnersetmessages: + msg293878
versions: + Python 3.5, Python 3.6, Python 3.7
2017-05-17 19:01:18vstinnersetpull_requests: + pull_request1729
2017-05-17 19:00:37vstinnersetpull_requests: + pull_request1727
2017-05-17 18:58:52vstinnersetmessages: + msg293875
2017-05-17 18:42:41vstinnersetmessages: + msg293871
2017-05-17 18:41:33vstinnersetpull_requests: + pull_request1724
2017-05-17 18:34:27vstinnersetmessages: + msg293869
2017-05-17 18:29:20vstinnersetmessages: + msg293868
2017-05-17 18:27:41vstinnersetmessages: + msg293867
2017-05-17 15:01:59xiang.zhangcreate