C0urante commented on code in PR #12490:
URL: https://github.com/apache/kafka/pull/12490#discussion_r950226900


##########
connect/runtime/src/test/java/org/apache/kafka/connect/storage/KafkaConfigBackingStoreTest.java:
##########
@@ -842,6 +842,7 @@ public void testBackgroundConnectorDeletion() throws 
Exception {
         // Task configs for the deleted connector should also be removed from 
the snapshot
         assertEquals(Collections.emptyList(), 
configState.allTaskConfigs(CONNECTOR_IDS.get(0)));
         assertEquals(0, configState.taskCount(CONNECTOR_IDS.get(0)));
+        assertEquals(0, configStorage.deferredTaskUpdates.size());

Review Comment:
   Nit: it's better if we can do a comparison of the entire map here, since 
that provides better error messages if the assertion fails.
   
   Also, we should add a comment explaining why we have this check since it may 
get removed in a future change if it's unclear why this is necessary.
   
   ```suggestion
           // Make sure the deleted connector is removed from the map in order 
to prevent unbounded growth
           assertEquals(Collections.emptyMap(), 
configStorage.deferredTaskUpdates);
   ```



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

Reply via email to