STINNER Victor <vstin...@python.org> added the comment:
I'm able to reproduce the issue if I reduce the sleep: diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 4cd8c7e25d..fc395dc473 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1177,7 +1177,7 @@ class MemoryHandlerTest(BaseTest): self.mem_hdlr.setTarget(target) for _ in range(10): - time.sleep(0.005) + time.sleep(1e-9) self.mem_logger.info("not flushed") self.mem_logger.warning("flushed") With the command: $ ./python -m test test_logging -m test_race_between_set_target_and_flush -F -j10 --fail-env-changed (...) 0:00:03 load avg: 3.74 [ 18/1] test_logging failed (env changed) Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2) Warning -- Dangling thread: <Thread(Thread-1 (removeTarget), started daemon 139860955428608)> Warning -- Dangling thread: <_MainThread(MainThread, started 139861194377024)> ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41739> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com