diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-12 21:37:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-12 21:37:02 (GMT) |
commit | 60f26691f5aeff555f27c62aee11efb07e20ecdc (patch) | |
tree | 409ae5651aed0496d89fc31eb1f1f952fe33215f | |
parent | 63e80e179877bbedc3d5d31d41017365ea79ddc7 (diff) | |
download | cpython-60f26691f5aeff555f27c62aee11efb07e20ecdc.zip cpython-60f26691f5aeff555f27c62aee11efb07e20ecdc.tar.gz cpython-60f26691f5aeff555f27c62aee11efb07e20ecdc.tar.bz2 |
Issue #25277: Use a longer sleep in test_eintr to reduce the risk of race
condition in test_eintr.
-rw-r--r-- | 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 index e1e0d91..e3c36f9 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -59,11 +59,6 @@ class EINTRBaseTest(unittest.TestCase): 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 @@ class SignalEINTRTest(EINTRBaseTest): @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() |