kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2461368631
##########
test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/KafkaClusterTestKit.java:
##########
@@ -482,6 +483,18 @@ private void formatNode(
formatter.setUnstableFeatureVersionsEnabled(true);
formatter.setIgnoreFormatted(false);
formatter.setControllerListenerName(controllerListenerName);
+
+ // Copy feature levels from TestKitNodes bootstrap metadata to
ensure test annotations are respected
+ for (var record : nodes.bootstrapMetadata().records()) {
+ if (record.message() instanceof FeatureLevelRecord
featureLevelRecord) {
+ String featureName = featureLevelRecord.name();
+ short level = featureLevelRecord.featureLevel();
+ // Don't override MetadataVersion as it's handled by
setReleaseVersion()
+ if (!featureName.equals("metadata.version")) {
+ formatter.setFeatureLevel(featureName, level);
+ }
+ }
+ }
Review Comment:
Some background on how the KafkaClusterTestKit works:
Basically, tests that use this class are "integration tests" in the sense
that we're trying to replicate a real cluster, just all within the same JVM.
That means multiple `brokerServers` and `controllerServers`. This file
shouldn't change outside of removing `nodes.bootstrapMetadata()` from the
ControllerServer constructor.
--
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]