ableegoldman commented on a change in pull request #8882: URL: https://github.com/apache/kafka/pull/8882#discussion_r441175266
########## File path: streams/src/test/java/org/apache/kafka/streams/processor/internals/StandbyTaskTest.java ########## @@ -366,6 +369,37 @@ public void shouldThrowOnCloseCleanCheckpointError() { EasyMock.replay(stateManager); } + @Test + public void shouldUnregisterMetricsInCloseClean() { + EasyMock.expect(stateManager.changelogPartitions()).andReturn(Collections.emptySet()).anyTimes(); + EasyMock.replay(stateManager); + + task = createStandbyTask(); + task.initializeIfNeeded(); + + task.suspend(); + task.closeClean(); + // Currently, there are no metrics registered for standby tasks. + // This is a regression test so that, if we add some, we will be sure to deregister them. + assertThat(getTaskMetrics(), empty()); + } + + @Test + public void shouldUnregisterMetricsInCloseDirty() { + EasyMock.expect(stateManager.changelogPartitions()).andReturn(Collections.emptySet()).anyTimes(); + EasyMock.replay(stateManager); + + task = createStandbyTask(); + task.initializeIfNeeded(); + + task.suspend(); + task.closeDirty(); + + // Currently, there are no metrics registered for standby tasks. + // This is a regression test so that, if we add some, we will be sure to deregister them. Review comment: 🙏 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org