[Python-checkins] r84910 - python/branches/py3k/Lib/test/test_subprocess.py

antoine.pitrou python-checkins at python.org
Mon Sep 20 01:06:53 CEST 2010


Author: antoine.pitrou
Date: Mon Sep 20 01:06:53 2010
New Revision: 84910

Log:
Try to make signal-sending tests in test_subprocess more robust on slow machines



Modified:
   python/branches/py3k/Lib/test/test_subprocess.py

Modified: python/branches/py3k/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k/Lib/test/test_subprocess.py	Mon Sep 20 01:06:53 2010
@@ -830,16 +830,18 @@
                              stdin=subprocess.PIPE, stderr=subprocess.PIPE)
 
         # Let the process initialize (Issue #3137)
-        time.sleep(0.1)
+        time.sleep(0.4)
         # The process should not terminate prematurely
         self.assertIsNone(p.poll())
         # Retry if the process do not receive the signal.
-        count, maxcount = 0, 3
+        count, maxcount = 0, 10
         while count < maxcount and p.poll() is None:
             getattr(p, method)(*args)
             time.sleep(0.1)
             count += 1
 
+        if count == maxcount:
+            self.skipTest("apparently failed to send the signal")
         self.assertIsNotNone(p.poll(), "the subprocess did not terminate")
         if count > 1:
             print("p.{}{} succeeded after "


More information about the Python-checkins mailing list