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
391af751
Kaydet (Commit)
391af751
authored
Haz 08, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14373: Other attempt to fix threaded test for lru_cache().
üst
e7070f09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
test_functools.py
Lib/test/test_functools.py
+11
-6
No files found.
Lib/test/test_functools.py
Dosyayı görüntüle @
391af751
...
...
@@ -1110,10 +1110,10 @@ class TestLRU:
self
.
assertEqual
(
currsize
,
0
)
start
=
threading
.
Event
()
def
full
(
f
,
*
args
):
def
full
(
k
):
start
.
wait
(
10
)
for
_
in
range
(
m
):
f
(
*
args
)
self
.
assertEqual
(
f
(
k
,
0
),
orig
(
k
,
0
)
)
def
clear
():
start
.
wait
(
10
)
...
...
@@ -1124,19 +1124,24 @@ class TestLRU:
sys
.
setswitchinterval
(
1e-6
)
try
:
# create n threads in order to fill cache
threads
=
[
threading
.
Thread
(
target
=
full
,
args
=
[
f
,
k
,
k
])
threads
=
[
threading
.
Thread
(
target
=
full
,
args
=
[
k
])
for
k
in
range
(
n
)]
with
support
.
start_threads
(
threads
):
start
.
set
()
hits
,
misses
,
maxsize
,
currsize
=
f
.
cache_info
()
self
.
assertLessEqual
(
misses
,
n
)
self
.
assertEqual
(
hits
,
m
*
n
-
misses
)
if
self
.
module
is
py_functools
:
# XXX: Why can be not equal?
self
.
assertLessEqual
(
misses
,
n
)
self
.
assertLessEqual
(
hits
,
m
*
n
-
misses
)
else
:
self
.
assertEqual
(
misses
,
n
)
self
.
assertEqual
(
hits
,
m
*
n
-
misses
)
self
.
assertEqual
(
currsize
,
n
)
# create n threads in order to fill cache and 1 to clear it
threads
=
[
threading
.
Thread
(
target
=
clear
)]
threads
+=
[
threading
.
Thread
(
target
=
full
,
args
=
[
f
,
k
,
k
])
threads
+=
[
threading
.
Thread
(
target
=
full
,
args
=
[
k
])
for
k
in
range
(
n
)]
start
.
clear
()
with
support
.
start_threads
(
threads
):
...
...
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