bbejeck commented on code in PR #21091:
URL: https://github.com/apache/kafka/pull/21091#discussion_r2607023708
##########
streams/src/test/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStoreTest.java:
##########
@@ -527,16 +527,13 @@ public void shouldTrackOldestOpenIteratorTimestamp() {
when(inner.all()).thenReturn(KeyValueIterators.emptyIterator());
init();
- KafkaMetric oldestIteratorTimestampMetric =
metric("oldest-iterator-open-since-ms");
- assertThat(oldestIteratorTimestampMetric, nullValue());
+ final KafkaMetric oldestIteratorTimestampMetric =
metric("oldest-iterator-open-since-ms");
+ assertThat(oldestIteratorTimestampMetric, not(nullValue()));
Review Comment:
The method looks up and returns the `oldest-iterator-open-since-ms` from the
metrics registry, returning null if it's not found. When we switched to only
registering when there was an open iterator, then this assertion should be
null, as the metric is not there. But now, since we register the metric on
startup, it should be in the registry. The metric `Gauge` is what will return
`0L` if there are no open iterators.
--
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]