jsancio commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r3220255694
##########
metadata/src/test/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadataTest.java:
##########
@@ -58,27 +53,27 @@ public class BootstrapMetadataTest {
setFeatureLevel((short) 7), (short) 0));
static class BootstrapTestDirectory implements AutoCloseable {
- File directory = null;
+ private final Path directory;
- synchronized BootstrapTestDirectory createDirectory() {
- directory = TestUtils.tempDirectory("BootstrapTestDirectory");
- return this;
+ static synchronized BootstrapTestDirectory createDirectory() {
+ return new BootstrapTestDirectory();
}
Review Comment:
Why is this synchronized? It does't read or modify any mutable shared state.
This applies to all of the usage of the synchronized keyword in this type.
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/KafkaClusterTestKit.java:
##########
@@ -477,6 +480,22 @@ private void formatNode(
formatter.setIgnoreFormatted(false);
formatter.setControllerListenerName(controllerListenerName);
formatter.setMetadataLogDirectory(ensemble.metadataLogDir().get());
+
+ List<ApiMessageAndVersion> additionalRecords = new ArrayList<>();
+ for (ApiMessageAndVersion record :
nodes.bootstrapMetadata().records()) {
+ if (record.message() instanceof FeatureLevelRecord
featureRecord) {
+ if
(!featureRecord.name().equals(MetadataVersion.FEATURE_NAME)) {
+ formatter.setFeatureLevel(featureRecord.name(),
featureRecord.featureLevel());
+ }
+ } else if (!(record.message() instanceof
UserScramCredentialRecord)) {
+ additionalRecords.add(record);
+ } else {
+ throw new RuntimeException("UserScramCredentialRecord is
not supported in " +
Review Comment:
Okay. This should be an IllegalStateException, no?
--
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]