]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109762)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 15:22:16 +0000 (08:22 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 15:22:16 +0000 (17:22 +0200)
gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707)

Don't check order, queue items can be written in any order.
(cherry picked from commit b03a791497ff4b3c42805e06c73d08ac34087402)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/_test_multiprocessing.py

index 044bfc97b8c66646feb4b61a16ff26d9a840d2d4..bf5d541af896cabb50117a79988c3f50f4fff9c5 100644 (file)
@@ -5434,7 +5434,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",