squah-confluent commented on code in PR #20780:
URL: https://github.com/apache/kafka/pull/20780#discussion_r2467188692
##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/DirectEventProcessor.java:
##########
@@ -16,31 +16,52 @@
*/
package org.apache.kafka.coordinator.common.runtime;
+import java.util.Deque;
+import java.util.LinkedList;
import java.util.concurrent.RejectedExecutionException;
/**
* A CoordinatorEventProcessor that directly executes the operations. This is
* useful in unit tests where execution in threads is not required.
*/
public class DirectEventProcessor implements CoordinatorEventProcessor {
+ private final Deque<CoordinatorEvent> queue;
+ private boolean inEvent;
+
+ public DirectEventProcessor() {
+ this.queue = new LinkedList<>();
+ this.inEvent = false;
+ }
+
Review Comment:
We can now enqueue flush events while in the middle of another event. The
flush event must be run _after_ the current event, so we have to introduce a
queue here.
##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeTest.java:
##########
@@ -2615,6 +2615,7 @@ public void testHighWatermarkUpdate() {
.withCoordinatorRuntimeMetrics(mock(CoordinatorRuntimeMetrics.class))
.withCoordinatorMetrics(mock(CoordinatorMetrics.class))
.withSerializer(new StringSerializer())
+ .withAppendLingerMs(0)
Review Comment:
Many of the tests in this file run with an adaptive linger time now, except
for those with an explicit linger time.
I updated a handful of tests using the `ManualEventProcessor` to use an
append linger time of 0 (preserving the existing behavior) to avoid test churn.
--
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]