Skip to content

Commit

Permalink
[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-1…
Browse files Browse the repository at this point in the history
…09707) (#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 b03a791)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner committed Oct 2, 2023
1 parent f6cb2e4 commit 6a6bea3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5434,7 +5434,9 @@ def test_nested_startmethod(self):
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",
Expand Down

0 comments on commit 6a6bea3

Please sign in to comment.