From 6a6bea3ee8bbe52e4307c4da1ed4a7b9c78cbe45 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:22:16 -0700 Subject: [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 b03a791497ff4b3c42805e06c73d08ac34087402) Co-authored-by: Victor Stinner --- Lib/test/_test_multiprocessing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 044bfc9..bf5d541 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -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", -- cgit v0.12