[3.13] gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) (GH-120093)

(cherry picked from commit 983efcf15b)
This commit is contained in:
Miss Islington (bot) 2024-06-05 08:59:41 +02:00 committed by GitHub
parent df8a98abee
commit 71f86eedeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -3928,12 +3928,16 @@ class ConfigDictTest(BaseTest):
def test_multiprocessing_queues(self):
# See gh-119819
import_helper.import_module('_multiprocessing') # will skip test if it's not available
# will skip test if it's not available
import_helper.import_module('_multiprocessing')
cd = copy.deepcopy(self.config_queue_handler)
from multiprocessing import Queue as MQ, Manager as MM
q1 = MQ() # this can't be pickled
q2 = MM().Queue() # a proxy queue for use when pickling is needed
for qspec in (q1, q2):
q3 = MM().JoinableQueue() # a joinable proxy queue
for qspec in (q1, q2, q3):
fn = make_temp_file('.log', 'test_logging-cmpqh-')
cd['handlers']['h1']['filename'] = fn
cd['handlers']['ah']['queue'] = qspec