kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2511640322


##########
metadata/src/test/java/org/apache/kafka/metadata/storage/FormatterTest.java:
##########
@@ -152,6 +154,19 @@ public void testDirectories(int numDirs) throws Exception {
         }
     }
 
+    @Test
+    public void testBrokerRoleSkipsBootstrapSnapshot() throws Exception {
+        try (TestEnv testEnv = new TestEnv(1)) {
+            FormatterContext context = testEnv.newFormatter();
+            context.formatter.setWriteBootstrapSnapshot(false);
+            context.formatter.run();
+            File clusterMetadataDir = new File(testEnv.directory(0), 
String.format("%s-%d",

Review Comment:
   `testEnv.directory(0)` contains the cluster metadata directory in these 
tests. Look at `testEnv.newFormatter()`. When you create the file here, you are 
looking for `tempDirectoryPath/__cluster-metadata-0`, which is a directory that 
SHOULD exist on the broker after formatting. However, the 
file`tempDirectoryPath/__cluster-metadata-0/0-0.checkpoint` SHOULD NOT exist on 
the broker.
   



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