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 martin.panter
Recipients martin.panter
Date 2016-08-17.14:33:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471444416.58.0.403066422395.issue27787@psf.upfronthosting.co.za>
In-reply-to
Content
In Issue 12319, there are many iterations of a patch that adds a new TestCase subclass to Lib/test/test_httplib.py. However it never got run by the main regrtest infrastructure, because nobody remembered to add the class to the list of test classes. So I want to remove test_main(). It seems this would let the classes be automatically discovered (like normal unittest usage).

I understand @reap_threads is to avoid background threads continuing between tests (especially when a test fails). I improved the cleanup of the background thread in one test. There are three other test methods using test.ssl_servers.make_https_server(), which also runs a background thread, but that already seems to clean itself up properly, via case.addCleanup(server.join).

I found that the test infrastructure randomly complained about dangling threads without @reap_threads. It uses a set of weak references to thread objects. The solution seems to be to call gc.collect() before checking. This is what @reap_threads does, so maybe my patch would eliminate the need for @reap_threads in other test files as well. In fact, if everybody called join() on their threads, we may be able to eliminate @reap_threads altogether.
History
Date User Action Args
2016-08-17 14:33:36martin.pantersetrecipients: + martin.panter
2016-08-17 14:33:36martin.pantersetmessageid: <1471444416.58.0.403066422395.issue27787@psf.upfronthosting.co.za>
2016-08-17 14:33:36martin.panterlinkissue27787 messages
2016-08-17 14:33:36martin.pantercreate