Skip to content

Commit

Permalink
gh-93761: Fix test_logging test_config_queue_handler() race condition (
Browse files Browse the repository at this point in the history
…#93952)

Fix a race condition in test_config_queue_handler() of test_logging.
  • Loading branch information
vstinner authored Jun 19, 2022
1 parent 59c1b33 commit dba3fa5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3603,6 +3603,9 @@ def do_queuehandler_configuration(self, qspec, lspec):
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'])
Expand Down

0 comments on commit dba3fa5

Please sign in to comment.