Closed sveta-afanaseva closed 11 months ago
Hi, can you provide the test for it? to run against real redis and fakeredis?
Yes, try this
from fakeredis import FakeRedis
from redis import Redis
def test_redis():
fake_redis = FakeRedis()
real_redis = Redis(host="localhost", port=6379)
fake_redis.xadd("test", {"x": 1})
real_redis.xadd("test", {"x": 1})
res1 = fake_redis.xread(streams={"test": "0"}, count=100, block=10)
res2 = real_redis.xread(streams={"test": "0"}, count=100, block=10)
assert len(res1) == len(res2)
Oh, sorry, it returns empty list, not None. My mistake
Ok, I wrote a test that is able to replicate it. I'll try to fix it this weekend.
Describe the bug Command XREAD returns empty list when COUNT is bigger than count of messages in stream. However, in redis python sdk it works another way (it returns all messages from the stream)
Some proofs https://github.com/redis/redis-py/blob/emb-examples/doctests/dt_stream.py#L43 https://redis.io/docs/data-types/streams/
To Reproduce Steps to reproduce the behavior:
Expected behavior Expected list of all messages in stream
Desktop (please complete the following information):