Skip to content

Commit

Permalink
fix: test_acl_cat_commands_multi_exec_squash (#4492)
Browse files Browse the repository at this point in the history
* add sleep in test

Signed-off-by: kostas <[email protected]>
  • Loading branch information
kostasrim authored Jan 22, 2025
1 parent 4b8fa90 commit d44eec2
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit d44eec2

Please sign in to comment.