Skip to content
Closed
Changes from 1 commit
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,16 +272,16 @@ 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, 2, latch);
final Thread two = adjustCountHelperThread(kafkaStreams, 3, latch);
Set<ThreadMetadata> threadMetadata = null;

AssertionError testError = null;
try {
two.start();
one.start();

assertTrue(latch.await(30, TimeUnit.SECONDS));
assertTrue(latch.await(90, TimeUnit.SECONDS));
Copy link
Member

Choose a reason for hiding this comment

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

Why increase the timeout when the number of threads is reduced?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @chia7712. I think this is not the right way to fix the test, also it's taken by someone else in the community. I guess I'll close this PR. Thanks!

one.join();
two.join();
waitForCondition(
Expand All @@ -290,7 +290,7 @@ public void shouldAddAndRemoveThreadsMultipleTimes() throws InterruptedException
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