gh-93761: Fix test_logging test_config_queue_handler() race condition (#93952)

Fix a race condition in test_config_queue_handler() of test_logging.
This commit is contained in:
Victor Stinner 2022-06-19 11:49:35 +02:00 committed by GitHub
parent 59c1b33805
commit dba3fa57e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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'])