xxxxxxjun commented on code in PR #22164:
URL: https://github.com/apache/kafka/pull/22164#discussion_r3153811280
##########
metadata/src/test/java/org/apache/kafka/image/loader/MetadataLoaderTest.java:
##########
@@ -524,35 +523,18 @@ public void testLoadEmptyBatch() throws Exception {
public void testKRaftVersionFinalizedLevelMetric() throws Exception {
MockFaultHandler faultHandler = new
MockFaultHandler("testKRaftVersionFinalizedLevelMetric");
MockTime time = new MockTime();
+ AtomicReference<KRaftVersion> currentKRaftVersion = new
AtomicReference<>(KRaftVersion.KRAFT_VERSION_0);
List<MockPublisher> publishers = List.of(new MockPublisher());
try (MetadataLoader loader = new MetadataLoader.Builder().
setFaultHandler(faultHandler).
setTime(time).
setHighWaterMarkAccessor(() -> OptionalLong.of(1L)).
+ setKraftVersionSupplier(currentKRaftVersion::get).
build()) {
loader.installPublishers(publishers).get();
loadTestSnapshot(loader, 200);
- assertThrows(
- NullPointerException.class,
- () ->
loader.metrics().finalizedFeatureLevel(KRaftVersion.FEATURE_NAME)
- );
Review Comment:
This assertion no longer holds. kraft.version is registered on every
publish, regardless of control records.
--
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]