Message272954
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. |
|
Date |
User |
Action |
Args |
2016-08-17 14:33:36 | martin.panter | set | recipients:
+ martin.panter |
2016-08-17 14:33:36 | martin.panter | set | messageid: <1471444416.58.0.403066422395.issue27787@psf.upfronthosting.co.za> |
2016-08-17 14:33:36 | martin.panter | link | issue27787 messages |
2016-08-17 14:33:36 | martin.panter | create | |
|