mcvsubbu commented on code in PR #12188:
URL: https://github.com/apache/pinot/pull/12188#discussion_r1433378961


##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/realtime/segment/SegmentFlushThresholdComputerTest.java:
##########
@@ -105,6 +106,28 @@ public void 
testUseLastSegmentsThresholdIfSegmentSizeMissing() {
     assertEquals(threshold, segmentSizeThreshold);
   }
 
+  @Test
+  public void 
testUseLastSegmentsThresholdIfSegmentIsCommittingDueToForceCommit() {
+    long committingSegmentSizeBytes = 500_000L;
+    int committingSegmentSizeThreshold = 25_000;
+    SegmentFlushThresholdComputer computer = new 
SegmentFlushThresholdComputer();
+
+    CommittingSegmentDescriptor committingSegmentDescriptor = 
mock(CommittingSegmentDescriptor.class);
+    
when(committingSegmentDescriptor.getSegmentSizeBytes()).thenReturn(committingSegmentSizeBytes);
+    
when(committingSegmentDescriptor.getStopReason()).thenReturn(REASON_FORCE_COMMIT_MESSAGE_RECEIVED);

Review Comment:
   maybe also add a test when the reason is null. (will happen during upgrades 
if servers are upgraded last)



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to