squah-confluent commented on code in PR #23688:
URL: https://github.com/apache/kafka/pull/23688#discussion_r4239527734


##########
coordinator-common/src/testFixtures/java/org/apache/kafka/coordinator/common/runtime/MockCoordinatorExecutor.java:
##########
@@ -103,4 +104,17 @@ public List<ExecutorResult<T>> poll() {
         queue.clear();
         return results;
     }
+
+    public ExecutorResult<T> poll(String key) {
+        Iterator<ExecutorTask<?>> it = queue.iterator();
+        while (it.hasNext()) {
+            ExecutorTask<?> task = it.next();
+            if (task.key.equals(key)) {
+                it.remove();
+                tasks.remove(task.key, task.task);
+                return new ExecutorResult<>(task.key, task.execute());
+            }
+        }
+        return null;
+    }

Review Comment:
   That is what it does. I don't follow what you mean. The real coordinator 
executor does not have ordering guarantees when there are multiple executor 
threads.
   
   The test that uses it is 
`testConsumerGroupAsyncTargetAssignmentCancelledOnRollbackAfterRegexResolution` 
and it wants a specific order where regex resolution completes before the async 
assignor.



-- 
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