diff --git a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala index f950362354c8c..76cdbc5020264 100644 --- a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala +++ b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala @@ -3121,8 +3121,10 @@ class AuthorizerIntegrationTest extends AbstractAuthorizerIntegrationTest { addAndVerifyAcls(Set(allowAllOpsAcl), groupResource) addAndVerifyAcls(Set(allowAllOpsAcl), topicResource) - val response = sendAndReceiveFirstRegexHeartbeat(Uuid.randomUuid.toString, listenerName) - sendAndReceiveRegexHeartbeat(response, listenerName, Some(1)) + var response = sendAndReceiveFirstRegexHeartbeat(Uuid.randomUuid.toString, listenerName) + TestUtils.tryUntilNoAssertionError() { + response = sendAndReceiveRegexHeartbeat(response, listenerName, Some(1)) + } } @Test