cadonna commented on code in PR #12161:
URL: https://github.com/apache/kafka/pull/12161#discussion_r897818350
##########
streams/src/test/java/org/apache/kafka/streams/integration/PauseResumeIntegrationTest.java:
##########
@@ -335,7 +333,39 @@ public void pauseResumehouldWorkAcrossInstances() throws
Exception {
kafkaStreams.resume();
waitForApplicationState(singletonList(kafkaStreams), State.RUNNING,
STARTUP_TIMEOUT);
- awaitOutput(OUTPUT_STREAM_1, 3, COUNT_OUTPUT_DATA);
+ awaitOutput(OUTPUT_STREAM_1, 5, COUNT_OUTPUT_DATA);
+ }
+
+ @Test
+ public void pausedTopologyShouldNotRestoreStateStores() throws Exception {
+ produceToInputTopics(INPUT_STREAM_1, STANDARD_INPUT_DATA);
+
+ kafkaStreams = buildKafkaStreams(OUTPUT_STREAM_1);
+ kafkaStreams2 = buildKafkaStreams(OUTPUT_STREAM_1);
+ kafkaStreams.start();
+ kafkaStreams2.start();
+
+ waitForApplicationState(Arrays.asList(kafkaStreams, kafkaStreams2),
State.RUNNING, STARTUP_TIMEOUT);
+
+ awaitOutput(OUTPUT_STREAM_1, 5, COUNT_OUTPUT_DATA);
+
+ kafkaStreams.close();
+ kafkaStreams2.close();
+
+ kafkaStreams = buildKafkaStreams(OUTPUT_STREAM_1);
+ kafkaStreams2 = buildKafkaStreams(OUTPUT_STREAM_1);
+ kafkaStreams.cleanUp();
+ kafkaStreams2.cleanUp();
+
+ kafkaStreams.pause();
+ kafkaStreams2.pause();
+ kafkaStreams.start();
+ kafkaStreams2.start();
+
+ waitForApplicationState(Arrays.asList(kafkaStreams, kafkaStreams2),
State.REBALANCING, STARTUP_TIMEOUT);
+
+ assertTrue(kafkaStreams.allLocalStorePartitionLags().isEmpty());
+ assertTrue(kafkaStreams2.allLocalStorePartitionLags().isEmpty());
Review Comment:
I played a bit around with the test and indeed if you add a
`Thread.sleep(2000)` before these asserts, the test fails because the returned
map is not empty. That means, the assignment was not finished before the
asserts were called.
--
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]