]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-109706: Fix multiprocessing test_nested_startmethod() (#109707)
authorVictor Stinner <vstinner@python.org>
Fri, 22 Sep 2023 21:49:32 +0000 (23:49 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Sep 2023 21:49:32 +0000 (23:49 +0200)
Don't check order, queue items can be written in any order.

Lib/test/_test_multiprocessing.py

index 2636a9cf7f5beeb3fb89c33e664977f202fca5ad..730b887dd4bcac36a48928f816ba11214067439f 100644 (file)
@@ -5472,7 +5472,9 @@ class TestStartMethod(unittest.TestCase):
         while not queue.empty():
             results.append(queue.get())
 
-        self.assertEqual(results, [2, 1])
+        # gh-109706: queue.put(1) can write into the queue before queue.put(2),
+        # there is no synchronization in the test.
+        self.assertSetEqual(set(results), set([2, 1]))
 
 
 @unittest.skipIf(sys.platform == "win32",