Skip to content

test.support.threading_cleanup() now logs a warning on failure#1195

Merged
vstinner merged 1 commit intopython:masterfrom
vstinner:threading_cleanup
Apr 20, 2017
Merged

test.support.threading_cleanup() now logs a warning on failure#1195
vstinner merged 1 commit intopython:masterfrom
vstinner:threading_cleanup

Conversation

@vstinner
Copy link
Copy Markdown
Member

The @reap_threads decorator and the threading_cleanup() function of
test.support now log a warning if they fail to clenaup threads.

The log may help to debug such other warning seen on the AMD64
FreeBSD CURRENT Non-Debug 3.x buildbot:

Warning -- threading._dangling was modified by test_logging

@vstinner vstinner added tests Tests in the Lib/test dir trivial labels Apr 19, 2017
@mention-bot
Copy link
Copy Markdown

@Haypo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Yhg1s, @ncoghlan and @benjaminp to be potential reviewers.

@vstinner vstinner changed the title support.threading_cleanup() log a warning on fail test.support.threading_cleanup() logs a warning on fail Apr 19, 2017
@vstinner vstinner changed the title test.support.threading_cleanup() logs a warning on fail test.support.threading_cleanup() logs a warning on failure Apr 19, 2017
@vstinner vstinner changed the title test.support.threading_cleanup() logs a warning on failure test.support.threading_cleanup() now logs a warning on failure Apr 19, 2017
The @reap_threads decorator and the threading_cleanup() function of
test.support now log a warning if they fail to clenaup threads.

Fix also the usage of support.threading_cleanup() in
test_urllib2_localnet.

The log may help to debug such other warning seen on the AMD64
FreeBSD CURRENT Non-Debug 3.x buildbot:

Warning -- threading._dangling was modified by test_logging
@vstinner
Copy link
Copy Markdown
Member Author

Oh, good job Travis! The GCC job passed, but the Clang job catched a bug in test_urllib2_localnet doesn't come from my change. It's just that my change makes the bug more obvious :-) It's now fixed as well.

@vstinner vstinner merged commit d20324a into python:master Apr 20, 2017
@vstinner vstinner deleted the threading_cleanup branch April 20, 2017 11:40
@serhiy-storchaka
Copy link
Copy Markdown
Member

I got following strange warning:

0:06:50 [178/404] test_threading passed
Warning -- threading_cleanup() failed to cleanup 0 threads after 5 sec (count: 0, dangling: 21)

Is this alright? I mean warning about 0 threads.

@vstinner
Copy link
Copy Markdown
Member Author

Warning -- threading_cleanup() failed to cleanup 0 threads after 5 sec (count: 0, dangling: 21)

I am also surprised by the warning, but I also saw it. I don't understand well how the function works. It's something about "dangling threads". If I understood correctly, if the number of dangling threads is not zero, a test "leaks" threads and should be fixed to not have side effect on following tests.

@vstinner
Copy link
Copy Markdown
Member Author

I added the warning because I saw that test_quick_connect() of test_asyncore took much longer than expected sometimes but only on FreeBSD. It was a bug which was quiet. The warning should help to detect bugs.

@vstinner
Copy link
Copy Markdown
Member Author

I also proposed a buildbot change to catch more warnings on buildbot: python/buildmaster-config#1 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants