cadonna commented on a change in pull request #9984: URL: https://github.com/apache/kafka/pull/9984#discussion_r565900452
########## File path: streams/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java ########## @@ -180,6 +182,19 @@ public void shouldRemoveStreamThread() throws Exception { } } + @Test + public void shouldnNotRemoveStreamThreadWithTimeout() throws Exception { + try (final KafkaStreams kafkaStreams = new KafkaStreams(builder.build(), properties)) { + addStreamStateChangeListener(kafkaStreams); + startStreamsAndWaitForRunning(kafkaStreams); + + final int oldThreadCount = kafkaStreams.localThreadsMetadata().size(); + stateTransitionHistory.clear(); + assertThrows(TimeoutException.class, () -> kafkaStreams.removeStreamThread(Duration.ZERO.minus(DEFAULT_DURATION))); Review comment: Have you thought of using the `KafkaStreams` constructor that takes a `Time` object? You can pass `MockTime` to the constructor and progress time as you want. ---------------------------------------------------------------- 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