Skip to content

Commit c7fccce

Browse files
committed
Update unit test to preserve the partition order while sending remote fetch requests
1 parent 2d859d1 commit c7fccce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,8 +3657,8 @@ class ReplicaManagerTest {
36573657
val capturedFetchInfos = remoteStorageFetchInfoArg.getAllValues.asScala
36583658
assertEquals(2, capturedFetchInfos.size, "Should have 2 remote storage fetch info calls")
36593659

3660-
val capturedTopicPartitions = capturedFetchInfos.map(_.topicIdPartition.topicPartition).toSet
3661-
assertTrue(capturedTopicPartitions.contains(tp0), "Should contain " + tp0)
3660+
val capturedTopicPartitions = capturedFetchInfos.map(_.topicIdPartition.topicPartition)
3661+
assertEquals(tp0, capturedTopicPartitions.head, "Should contain " + tp0 + " as first item")
36623662
assertTrue(capturedTopicPartitions.contains(tp1), "Should contain " + tp1)
36633663

36643664
// Verify the fetch info details are correct for both partitions
@@ -3765,8 +3765,8 @@ class ReplicaManagerTest {
37653765
val capturedFetchInfos = remoteStorageFetchInfoArg.getAllValues.asScala
37663766
assertEquals(2, capturedFetchInfos.size, "Should have 2 remote storage fetch info calls")
37673767

3768-
val capturedTopicPartitions = capturedFetchInfos.map(_.topicIdPartition.topicPartition).toSet
3769-
assertTrue(capturedTopicPartitions.contains(tp0), "Should contain " + tp0)
3768+
val capturedTopicPartitions = capturedFetchInfos.map(_.topicIdPartition.topicPartition)
3769+
assertEquals(tp0, capturedTopicPartitions.head, "Should contain " + tp0 + " as first item")
37703770
assertTrue(capturedTopicPartitions.contains(tp1), "Should contain " + tp1)
37713771

37723772
// Verify the fetch info details are correct for both partitions

0 commit comments

Comments
 (0)