Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c19ed37 commit f8904e9Copy full SHA for f8904e9
1 file changed
Lib/test/_test_multiprocessing.py
@@ -713,6 +713,27 @@ def test_task_done(self):
713
for p in workers:
714
p.join()
715
716
+ def test_no_import_lock_contention(self):
717
+ with test.support.temp_cwd():
718
+ module_name = 'imported_by_an_imported_module'
719
+ with open(module_name + '.py', 'w') as f:
720
+ f.write("""if 1:
721
+ import multiprocessing
722
+
723
+ q = multiprocessing.Queue()
724
+ q.put('knock knock')
725
+ q.get(timeout=3)
726
+ q.close()
727
+ del q
728
+ """)
729
730
+ with test.support.DirsOnSysPath(os.getcwd()):
731
+ try:
732
+ __import__(module_name)
733
+ except pyqueue.Empty:
734
+ self.fail("Probable regression on import lock contention;"
735
+ " see Issue #22853")
736
737
def test_timeout(self):
738
q = multiprocessing.Queue()
739
start = time.time()
0 commit comments