]> granicus.if.org Git - python/commitdiff
bpo-11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition...
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 15 May 2017 15:32:14 +0000 (17:32 +0200)
committerGitHub <noreply@github.com>
Mon, 15 May 2017 15:32:14 +0000 (17:32 +0200)
(cherry picked from commit f25a8de845d20349a265442eb0f3dcd71d0d7ac5)

Lib/test/test_multiprocessing.py
Misc/NEWS

index 8cc4f5423acd51a37a6b31e8c24178bad2374a29..4d39501ccb073ab1c4816ffb6c6c4df2b876a99e 100644 (file)
@@ -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
index 4c9f2d375e8911dc10c797257be4a48b623f5bd4..9b551dca908059d73fc890eb145fe98ed708851b 100644 (file)
--- 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.