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 vstinner
Recipients corona10, shihai1991, vstinner
Date 2020-10-11.22:05:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602453958.48.0.870050010026.issue41739@roundup.psfhosted.org>
In-reply-to
Content
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)>
History
Date User Action Args
2020-10-11 22:05:58vstinnersetrecipients: + vstinner, corona10, shihai1991
2020-10-11 22:05:58vstinnersetmessageid: <1602453958.48.0.870050010026.issue41739@roundup.psfhosted.org>
2020-10-11 22:05:58vstinnerlinkissue41739 messages
2020-10-11 22:05:58vstinnercreate