@@ -148,9 +148,6 @@ public void testPartitionExpirationMeterUsesTopicPartitionKey() throws Interrupt
148148 assertEquals (statusByPartition .size (), cancelledCount .get ());
149149 assertEquals (statusByPartition .size (), numResponse .get ());
150150 assertEquals (initialAggregateCount + statusByPartition .size (), DelayedRemoteListOffsets .AGGREGATE_EXPIRATION_METER .count ());
151- assertEquals (2 , DelayedRemoteListOffsets .PARTITION_EXPIRATION_METERS .size ());
152- assertEquals (2 , DelayedRemoteListOffsets .PARTITION_EXPIRATION_METERS .get (sharedPartition ).count ());
153- assertEquals (1 , DelayedRemoteListOffsets .PARTITION_EXPIRATION_METERS .get (otherPartition ).count ());
154151 }
155152
156153 @ Test
@@ -285,8 +282,9 @@ public void testPartialResponseWhenNotLeaderOrFollowerExceptionOnOnePartition()
285282 return true ;
286283 });
287284
285+ var failTopicIdPartition = new TopicIdPartition (Uuid .randomUuid (), 0 , "test1" );
288286 doThrow (new NotLeaderOrFollowerException ("Not leader or follower!" ))
289- .when (partitionOrException ).accept (new TopicIdPartition ( Uuid . randomUuid (), 0 , "test1" ) );
287+ .when (partitionOrException ).accept (failTopicIdPartition );
290288 AsyncOffsetReadFutureHolder <OffsetResultHolder .FileRecordsOrError > errorFutureHolder = mock (AsyncOffsetReadFutureHolder .class );
291289 CompletableFuture <OffsetResultHolder .FileRecordsOrError > errorTaskFuture = new CompletableFuture <>();
292290 when (errorFutureHolder .taskFuture ()).thenAnswer (f -> errorTaskFuture );
@@ -295,7 +293,7 @@ public void testPartialResponseWhenNotLeaderOrFollowerExceptionOnOnePartition()
295293 Map <TopicIdPartition , ListOffsetsPartitionStatus > statusByPartition = Map .of (
296294 new TopicIdPartition (Uuid .randomUuid (), new TopicPartition ("test" , 0 )), ListOffsetsPartitionStatus .builder ().futureHolderOpt (Optional .of (holder )).build (),
297295 new TopicIdPartition (Uuid .randomUuid (), new TopicPartition ("test" , 1 )), ListOffsetsPartitionStatus .builder ().futureHolderOpt (Optional .of (holder )).build (),
298- new TopicIdPartition ( Uuid . randomUuid (), new TopicPartition ( "test1" , 0 )) , ListOffsetsPartitionStatus .builder ().futureHolderOpt (Optional .of (errorFutureHolder )).build (),
296+ failTopicIdPartition , ListOffsetsPartitionStatus .builder ().futureHolderOpt (Optional .of (errorFutureHolder )).build (),
299297 new TopicIdPartition (Uuid .randomUuid (), new TopicPartition ("test1" , 1 )), ListOffsetsPartitionStatus .builder ().futureHolderOpt (Optional .of (holder )).build ()
300298 );
301299
0 commit comments