summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-19 09:49:35 (GMT)
committerGitHub <noreply@github.com>2022-06-19 09:49:35 (GMT)
commitdba3fa57e26c5b0f7a4bfd3228a9bc109f35b6c8 (patch)
tree23435f0b95e1bd677f2fe0197c9a7dbacef4498b /Lib/test/test_logging.py
parent59c1b33805fe553fe6a157ae9b346153b96f7ff1 (diff)
downloadcpython-dba3fa57e26c5b0f7a4bfd3228a9bc109f35b6c8.zip
cpython-dba3fa57e26c5b0f7a4bfd3228a9bc109f35b6c8.tar.gz
cpython-dba3fa57e26c5b0f7a4bfd3228a9bc109f35b6c8.tar.bz2
gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)
Fix a race condition in test_config_queue_handler() of test_logging.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 7859c60..0aec072 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'])