From: Victor Stinner Date: Sun, 19 Jun 2022 09:49:35 +0000 (+0200) Subject: gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952) X-Git-Tag: v3.12.0a1~1206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dba3fa57e26c5b0f7a4bfd3228a9bc109f35b6c8;p=thirdparty%2FPython%2Fcpython.git gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952) Fix a race condition in test_config_queue_handler() of test_logging. --- diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 7859c604f0ef..0aec0728c0a8 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -3603,6 +3603,9 @@ class ConfigDictTest(BaseTest): if qh.listener.queue.empty(): break + # wait until the handler completed its last task + qh.listener.queue.join() + with open(fn, encoding='utf-8') as f: data = f.read().splitlines() self.assertEqual(data, ['foo', 'bar', 'baz'])