dengziming commented on a change in pull request #9649:
URL: https://github.com/apache/kafka/pull/9649#discussion_r551722375



##########
File path: core/src/test/scala/unit/kafka/server/AlterIsrManagerTest.scala
##########
@@ -174,13 +172,24 @@ class AlterIsrManagerTest {
   }
 
   @Test
-  def testPartitionErrors(): Unit = {
-    val errors = Seq(Errors.INVALID_UPDATE_VERSION, 
Errors.UNKNOWN_TOPIC_OR_PARTITION, Errors.NOT_LEADER_OR_FOLLOWER)
-    errors.foreach(error => {
-      val alterIsrManager = testPartitionError(tp0, error)
-      // Any partition-level error should clear the item from the pending 
queue allowing for future updates
-      assertTrue(alterIsrManager.submit(AlterIsrItem(tp0, null, _ => { }, 0)))
-    })
+  def testInvalidUpdateVersion(): Unit = {
+    checkPartitionError(Errors.INVALID_UPDATE_VERSION)
+  }
+
+  @Test
+  def testUnknownTopicPartition(): Unit = {
+    checkPartitionError(Errors.UNKNOWN_TOPIC_OR_PARTITION)
+  }
+
+  @Test
+  def testNotLeaderOrFollower(): Unit = {
+    checkPartitionError(Errors.NOT_LEADER_OR_FOLLOWER)
+  }
+
+  def checkPartitionError(error: Errors): Unit = {

Review comment:
       Thanks, done.




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