Skip to content
New issue

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

fix: test_acl_cat_commands_multi_exec_squash #4492

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/dragonfly/acl_family_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,18 @@ async def test_acl_cat_commands_multi_exec_squash(df_factory):
res = await admin_client.execute_command("ACL SETUSER kk -@string")
assert res == "OK"

# We need to sleep because within dragonfly, we first reply to the client with
# "OK" and then we stream the update to proactor threads. The reason for this,
# are some connections might need to be evicted, so we first need to reply before
# we actually do that. Between those steps, there is a small window that the
# EXEC below might succeed.
await asyncio.sleep(1)

res = await client.execute_command("EXEC")
# TODO(we need to fix this, basiscally SQUASHED/MULTI transaction commands
# return multiple errors for each command failed. Since the nature of the error
# is the same, that a rule has changed we should squash those error messages into
# one.
logging.debug(f"Result is: {res}")
assert res[0].args[0] == "kk ACL rules changed between the MULTI and EXEC", res

await admin_client.aclose()
Expand Down
Loading