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



##########
File path: core/src/test/scala/unit/kafka/server/AlterIsrManagerTest.scala
##########
@@ -127,26 +127,24 @@ class AlterIsrManagerTest {
 
   @Test
   def testAuthorizationFailed(): Unit = {
-    val isrs = Seq(AlterIsrItem(tp0, new LeaderAndIsr(1, 1, List(1,2,3), 10), 
_ => { }, 0))
-    val manager = testTopLevelError(isrs, Errors.CLUSTER_AUTHORIZATION_FAILED)
-    // On authz error, we log the exception and keep retrying
-    assertFalse(manager.submit(AlterIsrItem(tp0, null, _ => { }, 0)))
+    testTopLevelError(Errors.CLUSTER_AUTHORIZATION_FAILED)
   }
 
   @Test
   def testStaleBrokerEpoch(): Unit = {
-    val isrs = Seq(AlterIsrItem(tp0, new LeaderAndIsr(1, 1, List(1,2,3), 10), 
_ => { }, 0))
-    val manager = testTopLevelError(isrs, Errors.STALE_BROKER_EPOCH)
-    // On stale broker epoch, we want to retry, so we don't clear items from 
the pending map
-    assertFalse(manager.submit(AlterIsrItem(tp0, null, _ => { }, 0)))
+    testTopLevelError(Errors.STALE_BROKER_EPOCH)
   }
 
   @Test
-  def testOtherErrors(): Unit = {
+  def testUnknownServer(): Unit = {
+    testTopLevelError(Errors.UNKNOWN_SERVER_ERROR)
+  }
+
+  def testTopLevelError(error: Errors): Unit = {

Review comment:
       Maybe rename this and "testPartitionError" to something slightly 
different so they don't look like actual test cases? Maybe something like 
"assertTopLevelError" or "checkTopLevelError".




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