Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8150492f
Kaydet (Commit)
8150492f
authored
Haz 24, 2012
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Speed up test_io by >2x by reducing the sleep time using setitimer instead of
alarm for the signal tests.
üst
7349eb27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
test_io.py
Lib/test/test_io.py
+5
-5
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
8150492f
...
...
@@ -2868,7 +2868,7 @@ class SignalsTest(unittest.TestCase):
try
:
wio
=
self
.
io
.
open
(
w
,
**
fdopen_kwargs
)
t
.
start
()
signal
.
alarm
(
1
)
signal
.
setitimer
(
signal
.
ITIMER_REAL
,
0.
1
)
# Fill the pipe enough that the write will be blocking.
# It will be interrupted by the timer armed above. Since the
# other thread has read one byte, the low-level write will
...
...
@@ -2912,7 +2912,7 @@ class SignalsTest(unittest.TestCase):
r
,
w
=
os
.
pipe
()
wio
=
self
.
io
.
open
(
w
,
**
fdopen_kwargs
)
try
:
signal
.
alarm
(
1
)
signal
.
setitimer
(
signal
.
ITIMER_REAL
,
0.
1
)
# Either the reentrant call to wio.write() fails with RuntimeError,
# or the signal handler raises ZeroDivisionError.
with
self
.
assertRaises
((
ZeroDivisionError
,
RuntimeError
))
as
cm
:
...
...
@@ -2947,7 +2947,7 @@ class SignalsTest(unittest.TestCase):
try
:
rio
=
self
.
io
.
open
(
r
,
**
fdopen_kwargs
)
os
.
write
(
w
,
b
"foo"
)
signal
.
alarm
(
1
)
signal
.
setitimer
(
signal
.
ITIMER_REAL
,
0.
1
)
# Expected behaviour:
# - first raw read() returns partial b"foo"
# - second raw read() returns EINTR
...
...
@@ -2991,13 +2991,13 @@ class SignalsTest(unittest.TestCase):
t
.
daemon
=
True
def
alarm1
(
sig
,
frame
):
signal
.
signal
(
signal
.
SIGALRM
,
alarm2
)
signal
.
alarm
(
1
)
signal
.
setitimer
(
signal
.
ITIMER_REAL
,
0.
1
)
def
alarm2
(
sig
,
frame
):
t
.
start
()
signal
.
signal
(
signal
.
SIGALRM
,
alarm1
)
try
:
wio
=
self
.
io
.
open
(
w
,
**
fdopen_kwargs
)
signal
.
alarm
(
1
)
signal
.
setitimer
(
signal
.
ITIMER_REAL
,
0.
1
)
# Expected behaviour:
# - first raw write() is partial (because of the limited pipe buffer
# and the first alarm)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment