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
4fef555e
Kaydet (Commit)
4fef555e
authored
Ara 15, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test_threadsignals more lax, and add notes
üst
810023db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
test_threadsignals.py
Lib/test/test_threadsignals.py
+7
-2
No files found.
Lib/test/test_threadsignals.py
Dosyayı görüntüle @
4fef555e
...
...
@@ -142,6 +142,9 @@ class ThreadSignals(unittest.TestCase):
# receive a signal. Check this by repeatedly interrupting a lock
# acquire in the main thread, and make sure that the lock acquire times
# out after the right amount of time.
# NOTE: this test only behaves as expected if C signals get delivered
# to the main thread. Otherwise lock.acquire() itself doesn't get
# interrupted and the test trivially succeeds.
self
.
start
=
None
self
.
end
=
None
self
.
sigs_recvd
=
0
...
...
@@ -159,7 +162,7 @@ class ThreadSignals(unittest.TestCase):
self
.
end
=
time
.
time
()
def
send_signals
():
for
_
in
range
(
40
):
time
.
sleep
(
0.0
5
)
time
.
sleep
(
0.0
2
)
os
.
kill
(
process_pid
,
signal
.
SIGUSR1
)
done
.
release
()
...
...
@@ -172,7 +175,9 @@ class ThreadSignals(unittest.TestCase):
# This allows for some timing and scheduling imprecision
self
.
assertLess
(
self
.
end
-
self
.
start
,
2.0
)
self
.
assertGreater
(
self
.
end
-
self
.
start
,
0.3
)
self
.
assertEqual
(
40
,
self
.
sigs_recvd
)
# If the signal is received several times before PyErr_CheckSignals()
# is called, the handler will get called less than 40 times.
self
.
assertGreater
(
self
.
sigs_recvd
,
20
)
finally
:
signal
.
signal
(
signal
.
SIGUSR1
,
old_handler
)
...
...
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