Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
6c5a30b4
Kaydet (Commit)
6c5a30b4
authored
Şub 08, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added tests for LocalMemCache deadlocks. refs #20613 and refs #18541.
Thanks Zach Smith for the patch.
üst
02add435
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tests.py
tests/cache/tests.py
+21
-0
No files found.
tests/cache/tests.py
Dosyayı görüntüle @
6c5a30b4
...
...
@@ -990,6 +990,18 @@ class CreateCacheTableForDBCacheTests(TestCase):
router
.
routers
=
old_routers
class
PicklingSideEffect
(
object
):
def
__init__
(
self
,
cache
):
self
.
cache
=
cache
self
.
locked
=
False
def
__getstate__
(
self
):
if
self
.
cache
.
_lock
.
active_writers
:
self
.
locked
=
True
return
{}
@override_settings
(
CACHES
=
caches_setting_for_tests
(
BACKEND
=
'django.core.cache.backends.locmem.LocMemCache'
,
))
...
...
@@ -1025,6 +1037,15 @@ class LocMemCacheTests(BaseCacheTests, TestCase):
self
.
assertEqual
(
caches
[
'default'
]
.
get
(
'value'
),
42
)
self
.
assertEqual
(
caches
[
'other'
]
.
get
(
'value'
),
None
)
def
test_locking_on_pickle
(
self
):
"""#20613/#18541 -- Ensures pickling is done outside of the lock."""
bad_obj
=
PicklingSideEffect
(
cache
)
cache
.
set
(
'set'
,
bad_obj
)
self
.
assertFalse
(
bad_obj
.
locked
,
"Cache was locked during pickling"
)
cache
.
add
(
'add'
,
bad_obj
)
self
.
assertFalse
(
bad_obj
.
locked
,
"Cache was locked during pickling"
)
def
test_incr_decr_timeout
(
self
):
"""incr/decr does not modify expiry time (matches memcached behavior)"""
key
=
'value'
...
...
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