Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static void closeCluster() {
private static StreamsBuilder builder;
private static Properties properties;
private static String appId = "";
public static final Duration DEFAULT_DURATION = Duration.ofSeconds(30);
public static final Duration DEFAULT_DURATION = Duration.ofSeconds(60);

@BeforeEach
public void setup(final TestInfo testInfo) {
Expand Down Expand Up @@ -272,8 +272,8 @@ public void shouldAddAndRemoveThreadsMultipleTimes() throws InterruptedException
stateTransitionHistory.clear();

final CountDownLatch latch = new CountDownLatch(2);
final Thread one = adjustCountHelperThread(kafkaStreams, 4, latch);
final Thread two = adjustCountHelperThread(kafkaStreams, 6, latch);
final Thread one = adjustCountHelperThread(kafkaStreams, 1, latch);
final Thread two = adjustCountHelperThread(kafkaStreams, 1, latch);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the right change? -- The method name literally says MultipleTimes so there seems to be an intent to add/remove threads multiple times. If we reduce this to one, it seems we are removing intended test coverage?

Set<ThreadMetadata> threadMetadata = null;

AssertionError testError = null;
Expand All @@ -284,13 +284,14 @@ public void shouldAddAndRemoveThreadsMultipleTimes() throws InterruptedException
assertTrue(latch.await(30, TimeUnit.SECONDS));
one.join();
two.join();

waitForCondition(
() -> kafkaStreams.metadataForLocalThreads().size() == oldThreadCount &&
kafkaStreams.state() == KafkaStreams.State.RUNNING,
DEFAULT_DURATION.toMillis(),
"Kafka Streams did not stabilize at the expected thread count and RUNNING state."
);

threadMetadata = kafkaStreams.metadataForLocalThreads();
assertThat(threadMetadata.size(), equalTo(oldThreadCount));
} catch (final AssertionError e) {
Expand Down