From 9d1983be503012e750f49d31b569f3fe4554c628 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 15 May 2017 17:32:14 +0200 Subject: [PATCH] bpo-11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition. (#1591) (cherry picked from commit f25a8de845d20349a265442eb0f3dcd71d0d7ac5) --- Lib/test/test_multiprocessing.py | 8 +++++++- Misc/NEWS | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 8cc4f5423a..4d39501ccb 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -840,7 +840,13 @@ class _TestCondition(BaseTestCase): cond.release() # check they have all woken - time.sleep(DELTA) + for i in range(10): + try: + if get_value(woken) == 6: + break + except NotImplementedError: + break + time.sleep(DELTA) self.assertReturnsIfImplemented(6, get_value, woken) # check state is not mucked up diff --git a/Misc/NEWS b/Misc/NEWS index 4c9f2d375e..9b551dca90 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -164,6 +164,9 @@ Build Tests ----- +- bpo-11790: Fix sporadic failures in + test_multiprocessing.WithProcessesTestCondition. + - bpo-30236: Backported test.regrtest options -m/--match and -G/--failfast from Python 3. -- 2.50.1