8000 gh-109960: Remove test_pty timeout of 10 seconds by vstinner · Pull Request #110058 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109960: Remove test_pty timeout of 10 seconds #110058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
gh-109960: Remove test_pty timeout of 10 seconds
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 very 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.
  • Loading branch information
vstinner committed Sep 28, 2023
commit 7140d489f99d9726e1ba32fe7de4bd24d87c1654
11 changes: 0 additions & 11 deletions Lib/test/test_pty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -101,9 +93,6 @@ def setUp(self):
except tty.error:
pass

def handle_sig(self, sig, frame):
self.fail("isatty hung")

@staticmethod
def handle_sighup(signum, frame):
pass
Expand Down
0