From 9b81414f826a7d819e22fd409990d8a719c914de Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 22 Sep 2023 23:49:32 +0200 Subject: [PATCH] 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 ac0ed397684f42..e83c4416cb05a3 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5396,7 +5396,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",