Jackie-Jiang commented on code in PR #14360:
URL: https://github.com/apache/pinot/pull/14360#discussion_r1828094306


##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverterTest.java:
##########
@@ -188,6 +188,9 @@ public void testNoRecordsIndexedRowMajorSegmentBuilder()
     
assertTrue(segmentMetadata.getAllColumns().containsAll(schema.getColumnNames()));
     assertEquals(segmentMetadata.getStartOffset(), "1");
     assertEquals(segmentMetadata.getEndOffset(), "100");
+    FileUtils.deleteQuietly(tmpDir);

Review Comment:
   We may add a `@AfterMethod` method to delete the `TMP_DIR` after every test. 
All other dirs are sub directory of the root temp dir



##########
pinot-core/src/test/java/org/apache/pinot/queries/RangeQueriesTest.java:
##########
@@ -97,7 +98,7 @@ protected List<IndexSegment> getIndexSegments() {
   private Set<String> _noDictionaryColumns;
   private Set<String> _rangeIndexColumns;
 
-  @BeforeClass
+  @BeforeMethod

Review Comment:
   We don't want to construct a new segment per method. We can share the same 
segment across all tests.
   You may add an `@AfterClass` method (we usually call it `tearDown()`) to 
destroy the segment and delete the dir. Closing `_indexSegment` is enough as 
`_indexSegments` is just a reference to it



##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/forward/FixedByteChunkSVForwardIndexTest.java:
##########
@@ -185,6 +185,8 @@ public void testLong(ChunkCompressionType compressionType, 
int version)
         Assert.assertFalse(fourByteOffsetReader.isFixedOffsetMappingType());
         Assert.assertFalse(eightByteOffsetReader.isFixedOffsetMappingType());
       }
+      eightByteOffsetReader.close();

Review Comment:
   These are not required because they are already closed with 
try-with-resources call. Same for other places



##########
pinot-core/src/test/java/org/apache/pinot/queries/AllNullQueriesTest.java:
##########
@@ -660,4 +661,12 @@ public void testQueries(ColumnDataType columnDataType, 
File indexDir, Query quer
     _indexSegment.destroy();
     FileUtils.deleteDirectory(indexDir);
   }
+
+  @AfterMethod
+  public void destroySegments() {
+    _indexSegment.destroy();
+    for (IndexSegment indexSegment : _indexSegments) {

Review Comment:
   (minor) Closing `_indexSegment` itself should be enough because 
`_indexSegments` is simply references. Same for other places



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

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to