@@ -38,7 +38,7 @@ def r(request):
38
38
39
39
@pytest .mark .skipif (HIREDIS_AVAILABLE , reason = "PythonParser only" )
40
40
@pytest .mark .onlynoncluster
41
- @skip_if_resp_version (2 )
41
+ # @skip_if_resp_version(2)
42
42
class TestCache :
43
43
@pytest .mark .parametrize (
44
44
"r" ,
@@ -200,36 +200,6 @@ def test_health_check_invalidate_cache(self, r):
200
200
# Make sure that value was invalidated
201
201
assert cache .get (("GET" , "foo" )) is None
202
202
203
- @pytest .mark .parametrize (
204
- "r" ,
205
- [{"cache" : CacheToolsAdapter (TTLCache (128 , 300 )), "use_cache" : True }],
206
- indirect = True ,
207
- )
208
- @pytest .mark .onlynoncluster
209
- def test_health_check_invalidate_cache_multithreaded (self , r , r2 ):
210
- cache = r .get_cache ()
211
- # Running commands over two threads
212
- threading .Thread (target = r .set ("foo" , "bar" )).start ()
213
- threading .Thread (target = r .set ("bar" , "foo" )).start ()
214
- # Wait for command execution to be finished
215
- time .sleep (0.1 )
216
- # get keys from server
217
- threading .Thread (target = r .get ("foo" )).start ()
218
- threading .Thread (target = r .get ("bar" )).start ()
219
- # Wait for command execution to be finished
220
- time .sleep (0.1 )
221
- # get key from local cache
222
- assert cache .get (("GET" , "foo" )) == b"bar"
223
- assert cache .get (("GET" , "bar" )) == b"foo"
224
- # change key in redis (cause invalidation)
225
- threading .Thread (target = r2 .set ("foo" , "baz" )).start ()
226
- threading .Thread (target = r2 .set ("bar" , "bar" )).start ()
227
- # Wait for health check
228
- time .sleep (2 )
229
- # Make sure that value was invalidated
230
- assert cache .get (("GET" , "foo" )) is None
231
- assert cache .get (("GET" , "bar" )) is None
232
-
233
203
@pytest .mark .parametrize (
234
204
"r" ,
235
205
[
@@ -605,34 +575,6 @@ def test_health_check_invalidate_cache(self, r, r2):
605
575
# Make sure that value was invalidated
606
576
assert cache .get (("GET" , "foo" )) is None
607
577
608
- @pytest .mark .parametrize (
609
- "r" ,
610
- [{"cache" : CacheToolsAdapter (TTLCache (128 , 300 )), "use_cache" : True }],
611
- indirect = True ,
612
- )
613
- @pytest .mark .onlycluster
614
- def test_health_check_invalidate_cache_multithreaded (self , r , r2 ):
615
- cache = r .nodes_manager .get_node_from_slot (10 ).redis_connection .get_cache ()
616
- # Running commands over two threads
617
- threading .Thread (target = r .set ("foo" , "bar" )).start ()
618
- threading .Thread (target = r .set ("bar" , "foo" )).start ()
619
- # Wait for command execution to be finished
620
- time .sleep (0.1 )
621
- # get keys from server
622
- threading .Thread (target = r .get ("foo" )).start ()
623
- threading .Thread (target = r .get ("bar" )).start ()
624
- # get key from local cache
625
- assert cache .get (("GET" , "foo" )) == b"bar"
626
- assert cache .get (("GET" , "bar" )) == b"foo"
627
- # change key in redis (cause invalidation)
628
- threading .Thread (target = r .set ("foo" , "baz" )).start ()
629
- threading .Thread (target = r .set ("bar" , "bar" )).start ()
630
- # Wait for health check
631
- time .sleep (2 )
632
- # Make sure that value was invalidated
633
- assert cache .get (("GET" , "foo" )) is None
634
- assert cache .get (("GET" , "bar" )) is None
635
-
636
578
@pytest .mark .parametrize (
637
579
"r" ,
638
580
[{"cache" : CacheToolsAdapter (TTLCache (128 , 300 )), "use_cache" : True }],
0 commit comments