diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-02 15:43:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 15:43:38 (GMT) |
commit | aaa8bf18c6e569abb178896a68786ad3857663e9 (patch) | |
tree | 972a8dc18602c8eb1202416849f14f89ac670e08 | |
parent | 2b96102f29d2634a69b04cc782236cb12d8e3e56 (diff) | |
download | cpython-aaa8bf18c6e569abb178896a68786ad3857663e9.zip cpython-aaa8bf18c6e569abb178896a68786ad3857663e9.tar.gz cpython-aaa8bf18c6e569abb178896a68786ad3857663e9.tar.bz2 |
[3.12] gh-109960: Remove test_pty timeout of 10 seconds (GH-110058) (#110060)
gh-109960: Remove test_pty timeout of 10 seconds (GH-110058)
In 2003, test_pty got a hardcoded timeout of 10 seconds to prevent
hanging on AIX & HPUX "if run after test_openpty":
commit 7d8145268ee282f14d6adce9305dc3c1c7ffec14. Since 2003, test_pty
was no longer reported to hang on AIX. But today, the test can fail
simply because a CI is busy running other tests in parallel.
The timeout of 10 seconds is no longer needed, just remove it.
Moreover, regrtest now has multiple built-in generic timeout
mecanisms.
(cherry picked from commit 5fdcea744024c8a19ddb57057bf5ec2889546c98)
Co-authored-by: Victor Stinner <vstinner@python.org>
-rw-r--r-- | Lib/test/test_pty.py | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index c9c2b42..a971f6b 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -80,17 +80,9 @@ def expectedFailureIfStdinIsTTY(fun): # because pty code is not too portable. class PtyTest(unittest.TestCase): def setUp(self): - old_alarm = signal.signal(signal.SIGALRM, self.handle_sig) - self.addCleanup(signal.signal, signal.SIGALRM, old_alarm) - old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) self.addCleanup(signal.signal, signal.SIGHUP, old_sighup) - # isatty() and close() can hang on some platforms. Set an alarm - # before running the test to make sure we don't hang forever. - self.addCleanup(signal.alarm, 0) - signal.alarm(10) - # Save original stdin window size. self.stdin_dim = None if _HAVE_WINSZ: @@ -101,9 +93,6 @@ class PtyTest(unittest.TestCase): except tty.error: pass - def handle_sig(self, sig, frame): - self.fail("isatty hung") - @staticmethod def handle_sighup(signum, frame): pass |