Skip to content

Commit e18abc6

Browse files
authored
gh-135329: Remove flaky test_repl_eio test (gh-145932)
The test doesn't actually test any pyrepl code (it runs Python with -S) and has a race condition that causes intermittent timeouts on CI.
1 parent 182aea2 commit e18abc6

File tree

2 files changed

+1
-128
lines changed

2 files changed

+1
-128
lines changed

Lib/test/test_pyrepl/eio_test_script.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

Lib/test/test_pyrepl/test_unix_console.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
import itertools
33
import os
44
import signal
5-
import subprocess
65
import sys
76
import threading
87
import unittest
98
from functools import partial
10-
from test import support
119
from test.support import os_helper, force_not_colorized_test_class
12-
from test.support import script_helper, threading_helper
10+
from test.support import threading_helper
1311

1412
from unittest import TestCase
1513
from unittest.mock import MagicMock, call, patch, ANY, Mock
@@ -369,34 +367,3 @@ def test_eio_error_handling_in_restore(self, mock_tcgetattr, mock_tcsetattr):
369367

370368
# EIO error should be handled gracefully in restore()
371369
console.restore()
372-
373-
@unittest.skipUnless(sys.platform == "linux", "Only valid on Linux")
374-
def test_repl_eio(self):
375-
# Use the pty-based approach to simulate EIO error
376-
script_path = os.path.join(os.path.dirname(__file__), "eio_test_script.py")
377-
378-
proc = script_helper.spawn_python(
379-
"-S", script_path,
380-
stderr=subprocess.PIPE,
381-
text=True
382-
)
383-
384-
ready_line = proc.stdout.readline().strip()
385-
if ready_line != "READY" or proc.poll() is not None:
386-
self.fail("Child process failed to start properly")
387-
388-
os.kill(proc.pid, signal.SIGUSR1)
389-
# sleep for pty to settle
390-
_, err = proc.communicate(timeout=support.LONG_TIMEOUT)
391-
self.assertEqual(
392-
proc.returncode,
393-
1,
394-
f"Expected EIO/ENXIO error, got return code {proc.returncode}",
395-
)
396-
self.assertTrue(
397-
(
398-
"Got EIO:" in err
399-
or "Got ENXIO:" in err
400-
),
401-
f"Expected EIO/ENXIO error message in stderr: {err}",
402-
)

0 commit comments

Comments
 (0)