feyman2016 commented on a change in pull request #8589: URL: https://github.com/apache/kafka/pull/8589#discussion_r431352788
########## File path: streams/src/test/java/org/apache/kafka/streams/integration/AbstractResetIntegrationTest.java ########## @@ -261,6 +261,42 @@ public void shouldNotAllowToResetWhenIntermediateTopicAbsent() throws Exception Assert.assertEquals(1, exitCode); } + public void testResetWhenLongSessionTimeoutConfiguredWithForceOption() throws Exception { + appID = testId + "-with-force-option"; + streamsConfig.put(StreamsConfig.APPLICATION_ID_CONFIG, appID); + streamsConfig.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "" + STREAMS_CONSUMER_TIMEOUT * 100); + + // Run + streams = new KafkaStreams(setupTopologyWithoutIntermediateUserTopic(), streamsConfig); + streams.start(); + final List<KeyValue<Long, Long>> result = IntegrationTestUtils.waitUntilMinKeyValueRecordsReceived(resultConsumerConfig, OUTPUT_TOPIC, 10); + + streams.close(); + + // RESET + streams = new KafkaStreams(setupTopologyWithoutIntermediateUserTopic(), streamsConfig); + streams.cleanUp(); + + // Reset would fail since long session timeout has been configured + final boolean cleanResult = tryCleanGlobal(false, null, null); + Assert.assertEquals(false, cleanResult); + + // Reset will success with --force, it will force delete active members on broker side + cleanGlobal(false, "--force", null); + + waitForEmptyConsumerGroup(adminClient, appID, TIMEOUT_MULTIPLIER * CLEANUP_CONSUMER_TIMEOUT); + + assertInternalTopicsGotDeleted(null); + + // RE-RUN Review comment: Yeah, I totally agree with: `It seems best to keep test to a "minimum".` Not sure if my understanding is correct, but I still think the tests for `resetter` should compare the first run and re-run results, from the test's perspective, it cannot assume that `--force` option won't do something underneath that make the re-run produce different results. But I'm ok to remove the RE-RUN part if we do think it's redundant. ---------------------------------------------------------------- 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