New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make support.threading_cleanup() stricter #75417
Comments
Currently, support.threading_cleanup() waits 1 second before emitting a warning about threads running in the background. I propose to emit immediately the warning to be able to catch bugs quicker, bugs like bpo-31233 or bpo-30830. The problem is that currently, 12 test files still leak threads: Since threading_cleanup() warnings now mark tests as failed, we should first fix these tests before being able to make support.threading_cleanup() stricter. |
test_fork1, test_wait3: #3139 |
test_threading: #3150 |
test_pydoc: see bpo-31238. |
test_logging: see bpo-30830. |
test_xmlrpc: bpo-31247, "test_xmlrpc leaks dangling threads". |
test_concurrent_futures: bpo-31249, test_concurrent_futures leaks dangling threads. |
test_asyncio: bpo-31250, "test_asyncio leaks dangling threads". |
test_ssl still emits a warning: see bpo-31323. |
Remaining issues:
|
I rebased PR 3138: 3 tests failed on Travis CI. test_ssl: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) test_poplib: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 3) test_ftplib: Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 4) |
test_ssl: test_recv_zero (test.test_ssl.ThreadedTests) ... server: new connection from ('127.0.0.1', 54502) test_socketserver (test.test_ssl.ThreadedTests) |
Hum, test_barrier of test_thread failed: 0:02:09 load avg: 2.50 [106/405/1] test_thread failed (env changed) -- running: test_multiprocessing_spawn (63 sec), test_multiprocessing_forkserver (54 sec) test_barrier (test.test_thread.BarrierTest) ... |
Source_ModuleLockAsRLockTests.test_different_thread() of test.test_importlib.test_locks failed: http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.x/builds/758/steps/test/logs/stdio test_different_thread (test.test_importlib.test_locks.Source_ModuleLockAsRLockTests) ... Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1) |
test_threading.test_foreign_thread() failed: 0:08:53 load avg: 1.84 [286/405/1] test_threading failed (env changed) -- running: test_multiprocessing_spawn (51 sec) |
3 more warnings in test_threading on AMD64 FreeBSD 10.x Shared 3.x: 0:03:45 load avg: 4.05 [246/405/1] test_thread failed (env changed) 0:05:44 load avg: 3.00 [249/405/1] test_thread failed (env changed) -- running: test_concurrent_futures (31 sec), test_multiprocessing_fork (60 sec) |
0:08:05 load avg: 1.58 [288/405/1] test_threading failed (env changed) -- running: test_multiprocessing_spawn (83 sec) Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 1) ok |
Oh, test_concurrent_futures.test_exception_with_success() failed on Travis CI :-( https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.6457 test_exception_with_success (test.test_concurrent_futures.FutureTests) ... Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2) |
Buildbots want my death :-( They never stop failing. Yet another random warning considered as an error: Run tests in parallel using 2 child processes |
Oh, one change of the commit b9b6900 introduced a regression x86 Gentoo Refleaks 3.x. It seems like 5 seconds is not enough on this slow buildbot. 2:28:30 load avg: 6.98 [263/405/1] test_multiprocessing_spawn failed -- running: test_zipfile (797 sec)
beginning 6 repetitions
123456
.Process Process-555:1:1:
Traceback (most recent call last):
File "/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py", line 4050, in child
join_process(p, timeout=5)
File "/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/test/_test_multiprocessing.py", line 79, in join_process
support.join_thread(process, timeout)
File "/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py", line 2117, in join_thread
raise AssertionError(msg)
AssertionError: failed to join the thread in 5.0 seconds |
It seems like all attached PR are now merged. I didn't see any random "dangling thread" warning recently in the master branch, so I close this issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: