chia7712 commented on a change in pull request #8657:
URL: https://github.com/apache/kafka/pull/8657#discussion_r441938174



##########
File path: 
core/src/test/scala/unit/kafka/coordinator/group/GroupCoordinatorConcurrencyTest.scala
##########
@@ -106,25 +97,56 @@ class GroupCoordinatorConcurrencyTest extends 
AbstractCoordinatorConcurrencyTest
     }
   }
 
-  def createGroupMembers(groupPrefix: String): Set[GroupMember] = {
-    (0 until nGroups).flatMap { i =>
-      new Group(s"$groupPrefix$i", nMembersPerGroup, groupCoordinator, 
replicaManager).members
-    }.toSet
+  private var producerIdCount = 0L
+  private val allGroupMembers = mutable.ArrayBuffer[GroupMember]()
+
+  def groupMembers(groupId: String, nMembers: Int, groupCoordinator: 
GroupCoordinator): Seq[GroupMember] = {
+    val groupPartitionId = groupCoordinator.partitionFor(groupId)
+    groupCoordinator.groupManager.addPartitionOwnership(groupPartitionId)
+    val lock = new ReentrantLock()
+    val producerId = producerIdCount
+    producerIdCount += 1

Review comment:
       Got it. However, the same producerId means the group completed by 
CompleteTxnOperation is possible to be impacted by any 
CommitTxnOffsetsOperation (since the partitions are same also). Hence, the 
side-effect is that we need a single lock to control the happen-before of txn 
completion and commit so the test will get slower.
   




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to