showuon commented on code in PR #15094:
URL: https://github.com/apache/kafka/pull/15094#discussion_r1438489270


##########
core/src/test/scala/unit/kafka/coordinator/AbstractCoordinatorConcurrencyTest.scala:
##########
@@ -148,25 +156,34 @@ abstract class AbstractCoordinatorConcurrencyTest[M <: 
CoordinatorMember] {
 }
 
 object AbstractCoordinatorConcurrencyTest {
-
   trait Action extends Runnable {
     def await(): Unit
   }
 
   trait CoordinatorMember {
   }
 
-  class TestReplicaManager extends ReplicaManager(
-    null, null, null, null, null, null, null, null, null, null, null, null, 
null, null, null, None, null) {
+  class TestReplicaManager(config: KafkaConfig,
+                           mtime: Time,
+                           scheduler: Scheduler,
+                           logManager: LogManager,
+                           quotaManagers: QuotaManagers,
+                           val watchKeys: 
mutable.Set[TopicPartitionOperationKey],
+                           val producePurgatory: 
DelayedOperationPurgatory[DelayedProduce])
+    extends ReplicaManager(
+      config,
+      metrics = null,
+      mtime,
+      scheduler,
+      logManager,
+      None,
+      quotaManagers,
+      null,
+      null,
+      null,
+      delayedProducePurgatoryParam = Some(producePurgatory)) {

Review Comment:
   I found while running the profiler that after we creating the real 
replicaManager, we'll also create `ExpirationReaper` threads for Fetch, 
RemoteFetch, ... etc. Although we will close them after the tests, we can 
actually avoid creating them beforehand like what we did in replicaManagerTest. 
(ref: 
https://github.com/apache/kafka/pull/15077/files#diff-5ace24a01ad7792f3c168abe80e4c23674d6ce8295f5a54a94933c4e4d75e7a5R2893)



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