kfaraz commented on code in PR #16044:
URL: https://github.com/apache/druid/pull/16044#discussion_r1516270979


##########
server/src/test/java/org/apache/druid/metadata/SqlSegmentsMetadataManagerTest.java:
##########
@@ -293,29 +292,32 @@ public void testPollPeriodicallyAndOnDemandInterleave() 
throws Exception
   @Test
   public void 
testPrepareImmutableDataSourceWithUsedSegmentsAwaitsPollOnRestart() throws 
IOException
   {
-    DataSegment newSegment = pollThenStopThenStartIntro();
+    publishWikiSegments();
+    DataSegment koalaSegment = pollThenStopThenStartIntro();

Review Comment:
   Yeah, I was thinking the same. Let me fix it up.



##########
server/src/test/java/org/apache/druid/metadata/SqlSegmentsMetadataManagerTest.java:
##########
@@ -511,346 +506,312 @@ public void testMarkSegmentAsUnused() throws 
IOException, InterruptedException
     sqlSegmentsMetadataManager.poll();
     
Assert.assertTrue(sqlSegmentsMetadataManager.isPollingDatabasePeriodically());
 
-    final String newDataSource = "wikipedia2";
-    final DataSegment newSegment = createSegment(
-        newDataSource,
+    final DataSegment koalaSegment = createSegment(
+        DS.KOALA,
         "2017-10-15T00:00:00.000/2017-10-16T00:00:00.000",
-        "2017-10-15T20:19:12.565Z",
-        
"wikipedia2/index/y=2017/m=10/d=15/2017-10-16T20:19:12.565Z/0/index.zip",
-        0
+        "2017-10-15T20:19:12.565Z"
     );
 
-    publisher.publishSegment(newSegment);
-    awaitDataSourceAppeared(newDataSource);
-    
Assert.assertNotNull(sqlSegmentsMetadataManager.getImmutableDataSourceWithUsedSegments(newDataSource));
+    publisher.publishSegment(koalaSegment);
+    awaitDataSourceAppeared(DS.KOALA);
+    
Assert.assertNotNull(sqlSegmentsMetadataManager.getImmutableDataSourceWithUsedSegments(DS.KOALA));
 
-    
Assert.assertTrue(sqlSegmentsMetadataManager.markSegmentAsUnused(newSegment.getId()));
-    awaitDataSourceDisappeared(newDataSource);
-    
Assert.assertNull(sqlSegmentsMetadataManager.getImmutableDataSourceWithUsedSegments(newDataSource));
+    
Assert.assertTrue(sqlSegmentsMetadataManager.markSegmentAsUnused(koalaSegment.getId()));
+    final Stopwatch stopwatch = Stopwatch.createStarted();
+    awaitDataSourceDisappeared(DS.KOALA);
+    
Assert.assertNull(sqlSegmentsMetadataManager.getImmutableDataSourceWithUsedSegments(DS.KOALA));
+    System.out.println("Total time:" + stopwatch.millisElapsed());

Review Comment:
   thanks for catching this, remnants from some debugging that I was doing.



-- 
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