Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 875c1bc

Browse files
committed
Backout change e8f44ebacda7052267318cecf5b6f128d35add17. Reverting the test
to using signal.alarm(1) instead of signal.setitimer(signal.ITIMER_REAL, 0.1). This is an attempt to see if this change is what caused the ubuntu arm buildbot to hang in test_io's test_interrupted_write_retry_text. Discussion in Issue #12268.
2 parents 48986d6 + b5ba203 commit 875c1bc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_io.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,7 +2912,7 @@ def _read():
29122912
try:
29132913
wio = self.io.open(w, **fdopen_kwargs)
29142914
t.start()
2915-
signal.setitimer(signal.ITIMER_REAL, 0.1)
2915+
signal.alarm(1)
29162916
# Fill the pipe enough that the write will be blocking.
29172917
# It will be interrupted by the timer armed above. Since the
29182918
# other thread has read one byte, the low-level write will
@@ -2957,7 +2957,7 @@ def on_alarm(*args):
29572957
r, w = os.pipe()
29582958
wio = self.io.open(w, **fdopen_kwargs)
29592959
try:
2960-
signal.setitimer(signal.ITIMER_REAL, 0.1)
2960+
signal.alarm(1)
29612961
# Either the reentrant call to wio.write() fails with RuntimeError,
29622962
# or the signal handler raises ZeroDivisionError.
29632963
with self.assertRaises((ZeroDivisionError, RuntimeError)) as cm:
@@ -2992,7 +2992,7 @@ def alarm_handler(sig, frame):
29922992
try:
29932993
rio = self.io.open(r, **fdopen_kwargs)
29942994
os.write(w, b"foo")
2995-
signal.setitimer(signal.ITIMER_REAL, 0.1)
2995+
signal.alarm(1)
29962996
# Expected behaviour:
29972997
# - first raw read() returns partial b"foo"
29982998
# - second raw read() returns EINTR
@@ -3036,13 +3036,13 @@ def _read():
30363036
t.daemon = True
30373037
def alarm1(sig, frame):
30383038
signal.signal(signal.SIGALRM, alarm2)
3039-
signal.setitimer(signal.ITIMER_REAL, 0.1)
3039+
signal.alarm(1)
30403040
def alarm2(sig, frame):
30413041
t.start()
30423042
signal.signal(signal.SIGALRM, alarm1)
30433043
try:
30443044
wio = self.io.open(w, **fdopen_kwargs)
3045-
signal.setitimer(signal.ITIMER_REAL, 0.1)
3045+
signal.alarm(1)
30463046
# Expected behaviour:
30473047
# - first raw write() is partial (because of the limited pipe buffer
30483048
# and the first alarm)

0 commit comments

Comments
 (0)