cryptoe commented on code in PR #16536:
URL: https://github.com/apache/druid/pull/16536#discussion_r1650431198


##########
server/src/test/java/org/apache/druid/segment/metadata/SegmentSchemaCacheTest.java:
##########
@@ -80,11 +80,23 @@ public void testCacheTemporaryMetadataQueryResults()
     Assert.assertTrue(schema.isPresent());
     Assert.assertEquals(expected, schema.get());
 
-    cache.resetTemporaryPublishedMetadataQueryResultOnDBPoll();
+    // simulate call after segment polling
 
-    Assert.assertFalse(cache.isSchemaCached(id));
+    ImmutableMap.Builder<SegmentId, SegmentMetadata> segmentMetadataBuilder = 
ImmutableMap.builder();
+    segmentMetadataBuilder.put(id, new SegmentMetadata(5L, "fp"));
+
+    ImmutableMap.Builder<String, SchemaPayload> schemaPayloadBuilder = 
ImmutableMap.builder();
+    schemaPayloadBuilder.put("fp", new SchemaPayload(rowSignature));
+
+    SegmentSchemaCache.FinalizedSegmentSchemaInfo finalizedSegmentSchemaInfo =
+        new 
SegmentSchemaCache.FinalizedSegmentSchemaInfo(segmentMetadataBuilder.build(), 
schemaPayloadBuilder.build());
+
+    cache.updateFinalizedSegmentSchema(finalizedSegmentSchemaInfo);
+
+    Assert.assertNull(cache.getTemporaryPublishedMetadataQueryResults(id));

Review Comment:
   We should have one ut where 
cache.getTemporaryPublishedMetadataQueryResults(id2) where id2 is not present 
in db poll but got back filled. 



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