mcvsubbu commented on a change in pull request #5173: Fix selection early 
termination test
URL: https://github.com/apache/incubator-pinot/pull/5173#discussion_r396746175
 
 

 ##########
 File path: 
pinot-core/src/test/java/org/apache/pinot/queries/SelectionOnlyEarlyTerminationTest.java
 ##########
 @@ -61,8 +62,13 @@ public void testSelectOnlyQuery() {
       assertNotNull(brokerResponse.getSelectionResults());
       assertNull(brokerResponse.getResultTable());
       assertEquals(brokerResponse.getNumSegmentsProcessed(), 
numSegmentsPerServer * NUM_SERVERS);
-      assertEquals(brokerResponse.getNumSegmentsMatched(), numThreadsPerServer 
* NUM_SERVERS);
-      assertEquals(brokerResponse.getNumDocsScanned(), numThreadsPerServer * 
NUM_SERVERS * limit);
+      // NOTE: 'numSegmentsMatched' and 'numDocsScanned' could be in a range 
because when the CombineOperator second
+      //       phase merge early terminates, the operators might not finish 
scanning the documents
+      long numSegmentsMatched = brokerResponse.getNumSegmentsMatched();
+      assertTrue(numSegmentsMatched >= NUM_SERVERS && numSegmentsMatched <= 
numThreadsPerServer * NUM_SERVERS);
+      long numDocsScanned = brokerResponse.getNumDocsScanned();
+      assertTrue(
+          numDocsScanned >= NUM_SERVERS * limit && numSegmentsMatched <= 
numThreadsPerServer * NUM_SERVERS * limit);
 
 Review comment:
   ```suggestion
             numDocsScanned >= NUM_SERVERS * limit && numDocsScanned <= 
numThreadsPerServer * NUM_SERVERS * limit);
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to