Skip to content

Commit 6a6bea3

Browse files
[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 b03a791) Co-authored-by: Victor Stinner <[email protected]>
1 parent f6cb2e4 commit 6a6bea3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5434,7 +5434,9 @@ def test_nested_startmethod(self):
54345434
while not queue.empty():
54355435
results.append(queue.get())
54365436

5437-
self.assertEqual(results, [2, 1])
5437+
# gh-109706: queue.put(1) can write into the queue before queue.put(2),
5438+
# there is no synchronization in the test.
5439+
self.assertSetEqual(set(results), set([2, 1]))
54385440

54395441

54405442
@unittest.skipIf(sys.platform == "win32",

0 commit comments

Comments
 (0)