Skip to content

Commit 5fdcea7

Browse files
authored
gh-109960: Remove test_pty timeout of 10 seconds (#110058)
In 2003, test_pty got a hardcoded timeout of 10 seconds to prevent hanging on AIX & HPUX "if run after test_openpty": commit 7d81452. 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.
1 parent b488c0d commit 5fdcea7

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

Lib/test/test_pty.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,9 @@ def expectedFailureIfStdinIsTTY(fun):
8080
# because pty code is not too portable.
8181
class PtyTest(unittest.TestCase):
8282
def setUp(self):
83-
old_alarm = signal.signal(signal.SIGALRM, self.handle_sig)
84-
self.addCleanup(signal.signal, signal.SIGALRM, old_alarm)
85-
8683
old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup)
8784
self.addCleanup(signal.signal, signal.SIGHUP, old_sighup)
8885

89-
# isatty() and close() can hang on some platforms. Set an alarm
90-
# before running the test to make sure we don't hang forever.
91-
self.addCleanup(signal.alarm, 0)
92-
signal.alarm(10)
93-
9486
# Save original stdin window size.
9587
self.stdin_dim = None
9688
if _HAVE_WINSZ:
@@ -101,9 +93,6 @@ def setUp(self):
10193
except tty.error:
10294
pass
10395

104-
def handle_sig(self, sig, frame):
105-
self.fail("isatty hung")
106-
10796
@staticmethod
10897
def handle_sighup(signum, frame):
10998
pass

0 commit comments

Comments
 (0)