Skip to content

Commit 7b50300

Browse files
committed
Removed usntable multithreaded tests
1 parent 8a2a01e commit 7b50300

File tree

1 file changed

+1
-59
lines changed

1 file changed

+1
-59
lines changed

tests/test_cache.py

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def r(request):
3838

3939
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
4040
@pytest.mark.onlynoncluster
41-
@skip_if_resp_version(2)
41+
#@skip_if_resp_version(2)
4242
class TestCache:
4343
@pytest.mark.parametrize(
4444
"r",
@@ -200,36 +200,6 @@ def test_health_check_invalidate_cache(self, r):
200200
# Make sure that value was invalidated
201201
assert cache.get(("GET", "foo")) is None
202202

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-
233203
@pytest.mark.parametrize(
234204
"r",
235205
[
@@ -605,34 +575,6 @@ def test_health_check_invalidate_cache(self, r, r2):
605575
# Make sure that value was invalidated
606576
assert cache.get(("GET", "foo")) is None
607577

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-
636578
@pytest.mark.parametrize(
637579
"r",
638580
[{"cache": CacheToolsAdapter(TTLCache(128, 300)), "use_cache": True}],

0 commit comments

Comments
 (0)