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


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -4912,7 +4919,9 @@ class ReplicaManagerTest {
       assertTrue(fooPart eq fooPart2)
       val bar1 = new TopicPartition("bar", 1)
       replicaManager.markPartitionOffline(bar1)
-      assertEquals(None, replicaManager.getOrCreatePartition(bar1, emptyDelta, 
BAR_UUID))
+      val (barPart, barNew) = replicaManager.getOrCreatePartition(bar1, 
emptyDelta, BAR_UUID).get
+      assertTrue(barNew)
+      assertEquals(bar1, barPart.topicPartition)

Review Comment:
   Could we add a test case for returning `None`?
   Since after this PR, we'll have 2 cases when creating partition in 
OfflinePartition, we should test them both.



##########
core/src/test/scala/unit/kafka/cluster/PartitionTest.scala:
##########
@@ -3805,4 +3805,281 @@ class PartitionTest extends AbstractPartitionTest {
       
when(kRaftMetadataCache.getAliveBrokerEpoch(broker)).thenReturn(Option(defaultBrokerEpoch(broker)))
     }
   }
+
+  @ParameterizedTest
+  @ValueSource(booleans = Array(false, true))
+  def makeLeaderInvokesgetOrCreateLog_OnOnlineLogDir(isNew: Boolean): Unit = {

Review Comment:
   Thanks for adding the tests.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to