[Python-checkins] cpython (3.5): Issue #25277: Use a longer sleep in test_eintr to reduce the risk of race

victor.stinner python-checkins at python.org
Mon Oct 12 17:37:45 EDT 2015


https://hg.python.org/cpython/rev/605eda657884
changeset:   98716:605eda657884
branch:      3.5
parent:      98709:272bb3f06da8
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Oct 12 23:37:02 2015 +0200
summary:
  Issue #25277: Use a longer sleep in test_eintr to reduce the risk of race
condition in test_eintr.

files:
  Lib/test/eintrdata/eintr_tester.py |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -59,11 +59,6 @@
         cls.stop_alarm()
         signal.signal(signal.SIGALRM, cls.orig_handler)
 
-    @classmethod
-    def _sleep(cls):
-        # default sleep time
-        time.sleep(cls.sleep_time)
-
     def subprocess(self, *args, **kw):
         cmd_args = (sys.executable, '-c') + args
         return subprocess.Popen(cmd_args, **kw)
@@ -375,6 +370,11 @@
     @unittest.skipUnless(hasattr(signal, 'sigwaitinfo'),
                          'need signal.sigwaitinfo()')
     def test_sigwaitinfo(self):
+        # Issue #25277: The sleep is a weak synchronization between the parent
+        # and the child process. If the sleep is too low, the test hangs on
+        # slow or highly loaded systems.
+        self.sleep_time = 2.0
+
         signum = signal.SIGUSR1
         pid = os.getpid()
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list