mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-15 17:51:06 +00:00
chore: add retry to test_noreply_pipeline test (#4045)
This commit is contained in:
parent
76b1f537b5
commit
cc6fdd7fbf
1 changed files with 12 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import logging
|
||||||
import pytest
|
import pytest
|
||||||
from pymemcache.client.base import Client as MCClient
|
from pymemcache.client.base import Client as MCClient
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
|
@ -50,7 +51,7 @@ def test_basic(memcached_client: MCClient):
|
||||||
|
|
||||||
|
|
||||||
@dfly_args(DEFAULT_ARGS)
|
@dfly_args(DEFAULT_ARGS)
|
||||||
def test_noreply_pipeline(df_server: DflyInstance, memcached_client: MCClient):
|
async def test_noreply_pipeline(df_server: DflyInstance, memcached_client: MCClient):
|
||||||
"""
|
"""
|
||||||
With the noreply option the python client doesn't wait for replies,
|
With the noreply option the python client doesn't wait for replies,
|
||||||
so all the commands are pipelined. Assert pipelines work correctly and the
|
so all the commands are pipelined. Assert pipelines work correctly and the
|
||||||
|
@ -67,10 +68,17 @@ def test_noreply_pipeline(df_server: DflyInstance, memcached_client: MCClient):
|
||||||
# check all commands were executed
|
# check all commands were executed
|
||||||
assert memcached_client.get_many(keys) == {k: v.encode() for k, v in zip(keys, values)}
|
assert memcached_client.get_many(keys) == {k: v.encode() for k, v in zip(keys, values)}
|
||||||
|
|
||||||
info = Redis(port=df_server.port).info()
|
client = df_server.client()
|
||||||
|
info = await client.info()
|
||||||
if info["total_pipelined_commands"] == 0:
|
if info["total_pipelined_commands"] == 0:
|
||||||
warnings.warn("No pipelined commands were detected. Info: \n" + str(info))
|
logging.error("No pipelined commands were detected. Info: \n" + str(info))
|
||||||
assert False, "No pipelined commands were detected."
|
|
||||||
|
# Try again
|
||||||
|
for k, v in zip(keys, values):
|
||||||
|
memcached_client.set(k, v, noreply=True)
|
||||||
|
info = await client.info()
|
||||||
|
logging.error("Second Info: \n" + str(info))
|
||||||
|
assert False
|
||||||
|
|
||||||
|
|
||||||
@dfly_args(DEFAULT_ARGS)
|
@dfly_args(DEFAULT_ARGS)
|
||||||
|
|
Loading…
Reference in a new issue