diff --git a/tests/dragonfly/acl_family_test.py b/tests/dragonfly/acl_family_test.py index f9d4b3003a0e..393174fbe333 100644 --- a/tests/dragonfly/acl_family_test.py +++ b/tests/dragonfly/acl_family_test.py @@ -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()