https://github.com/python/cpython/commit/6e9845455e0c49792b26732dfadb1e1c5aab8bea
commit: 6e9845455e0c49792b26732dfadb1e1c5aab8bea
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-07T19:38:12+02:00
summary:

[3.14] gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503) 
(#139506)

gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503)

Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.

Fix the following error on slow CI such as GitHub Action UBSan:

test test_pyrepl failed -- Traceback (most recent call last):
  File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
    _, err = proc.communicate(timeout=5)  # sleep for pty to settle
             ~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "Lib/subprocess.py", line 1219, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 2126, in _communicate
    self._check_timeout(endtime, orig_timeout, stdout, stderr)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Lib/subprocess.py", line 1266, in _check_timeout
    raise TimeoutExpired(
    ...<2 lines>...
            stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
(cherry picked from commit c985822d86892cd0a978e6e63945be3c0e59217c)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/test/test_pyrepl/test_unix_console.py

diff --git a/Lib/test/test_pyrepl/test_unix_console.py 
b/Lib/test/test_pyrepl/test_unix_console.py
index 3b0d2637dab9cb..6e422806cec47e 100644
--- a/Lib/test/test_pyrepl/test_unix_console.py
+++ b/Lib/test/test_pyrepl/test_unix_console.py
@@ -6,6 +6,7 @@
 import sys
 import unittest
 from functools import partial
+from test import support
 from test.support import os_helper, force_not_colorized_test_class
 from test.support import script_helper
 
@@ -359,7 +360,8 @@ def test_repl_eio(self):
             self.fail("Child process failed to start properly")
 
         os.kill(proc.pid, signal.SIGUSR1)
-        _, err = proc.communicate(timeout=5)  # sleep for pty to settle
+        # sleep for pty to settle
+        _, err = proc.communicate(timeout=support.SHORT_TIMEOUT)
         self.assertEqual(
             proc.returncode,
             1,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to