[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109762)

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 b03a791497)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2023-10-02 08:22:16 -07:00 committed by GitHub
parent f6cb2e4815
commit 6a6bea3ee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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",