lianetm commented on code in PR #17368:
URL: https://github.com/apache/kafka/pull/17368#discussion_r1792014521


##########
core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala:
##########
@@ -1137,8 +1136,16 @@ class AuthorizerIntegrationTest extends 
AbstractAuthorizerIntegrationTest {
     addAndVerifyAcls(Set(new AccessControlEntry(clientPrincipalString, 
WILDCARD_HOST, READ, ALLOW)), groupResource)
 
     val consumer = createConsumer()
-    consumer.subscribe(Pattern.compile(topicPattern))
-    consumer.poll(0)
+    consumer.subscribe(Pattern.compile(topicPattern), new 
ConsumerRebalanceListener {
+      def onPartitionsAssigned(partitions: util.Collection[TopicPartition]): 
Unit = {
+        assignSemaphore.release()
+      }
+      def onPartitionsRevoked(partitions: util.Collection[TopicPartition]): 
Unit = {
+      }})
+    TestUtils.waitUntilTrue(() => {
+      consumer.poll(Duration.ofMillis(500))
+      assignSemaphore.tryAcquire()
+    }, "Assignment did not complete on time")

Review Comment:
   Sure, both work, I'm ok with this one too



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to