From 9954f6fdd6a9fff6d574d951077af60eee2c5368 Mon Sep 17 00:00:00 2001 From: Greg Harris Date: Fri, 6 Jan 2023 10:28:13 -0800 Subject: [PATCH] KAFKA-14535: Fix flaky EndToEndAuthorization tests which were sensitive to ACL change reordering The ACL change methods (create, delete) are eventually consistent across a Kafka cluster. As part of that, changes to the same resource made to different brokers may be reordered. In this test, a delete operation initiated in noConsumeWithoutDescribeAclSetup was being reordered to an unexpected time later in the test, causing an expected ACL to be missing. To fix this, add a wait condition that asserts that the delete operations initiated in noConsumeWithoutDescribeAclSetup are completely applied before returning from the method. Note: test failures were present for both the ZK and KRAFT iterations of the test, but the ZK iteration encountered it much more often, and was used to diagnose the reordering. Signed-off-by: Greg Harris --- .../scala/integration/kafka/api/EndToEndAuthorizationTest.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala index f4c51a51b8824..7731efd360f63 100644 --- a/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala +++ b/core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala @@ -502,6 +502,7 @@ abstract class EndToEndAuthorizationTest extends IntegrationTestHarness with Sas superuserAdminClient.deleteAcls(List(AclTopicWrite().toFilter).asJava).values brokers.foreach { s => + TestUtils.waitAndVerifyAcls(TopicCreateAcl, s.dataPlaneRequestProcessor.authorizer.get, topicResource) TestUtils.waitAndVerifyAcls(GroupReadAcl, s.dataPlaneRequestProcessor.authorizer.get, groupResource) } }