We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
fakeredis-py returns unexpected values for get that appear to be left over results from the previous command
get
To Reproduce Steps to reproduce the behavior:
Run the following test case with pytest
@pytest.mark.asyncio async def test_cause_fakeredis_bug(): redis = fakeredis.FakeAsyncRedis() async def worker_task(): await redis.rpush("list1", "list1_val") assert await redis.blpop("list2") == (b"list2", b"list2_val") await redis.set("foo", "bar") async with asyncio.TaskGroup() as tg: tg.create_task(worker_task()) assert await redis.blpop("list1") == (b"list1", b"list1_val") await redis.rpush("list2", "list2_val") # await redis.get("foo") # uncomment to make test pass > assert await redis.get("foo") == b"bar" E AssertionError: assert b'OK' == b'bar' E E At index 0 diff: b'O' != b'b' E E Full diff: E - b'bar' E + b'OK'
Expected behavior Test passes. This test passes with redis-py v5.0.7.
Screenshots N/A
Desktop (please complete the following information):
Linux 6.10.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +0000 x86_64 GNU/Linux
Additional context Doing another get (see commented-out line in test case above) seems to re-sync the connection and cause the test to pass.
The text was updated successfully, but these errors were encountered:
I am surprised this is the first time this was mentioned. Anyway, should be fixed.
Sorry, something went wrong.
Thanks so much for the quick fix, I seriously appreciate what this library has helped me do. Was removing this call to put_response the main change?
put_response
yes, it is writing the response a few lines afterwards in the finally section
finally
No branches or pull requests
Describe the bug
fakeredis-py returns unexpected values for
get
that appear to be left over results from the previous commandTo Reproduce
Steps to reproduce the behavior:
Run the following test case with pytest
Expected behavior
Test passes. This test passes with redis-py v5.0.7.
Screenshots
N/A
Desktop (please complete the following information):
Linux 6.10.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +0000 x86_64 GNU/Linux
Additional context
Doing another
get
(see commented-out line in test case above) seems to re-sync the connection and cause the test to pass.Upvote & Fund
The text was updated successfully, but these errors were encountered: