Skip to content

KAFKA-20786: Speed up TimeWindowedKStreamIntegrationTest - #22824

Merged
mjsax merged 1 commit into
apache:trunkfrom
mjsax:kafka-20786-fix-test-utils
Jul 15, 2026
Merged

KAFKA-20786: Speed up TimeWindowedKStreamIntegrationTest#22824
mjsax merged 1 commit into
apache:trunkfrom
mjsax:kafka-20786-fix-test-utils

Conversation

@mjsax

@mjsax mjsax commented Jul 14, 2026

Copy link
Copy Markdown
Member

Currently, the test needs to wait for 45sec for session timeout to
expire. With a 60sec test timeout the test is flaky.

This PR let Kafka Streams send a leave group request on close() which
reduces the test runtime (for a single parameter run) from about 50sec
to 5sec.

Reviewers: Bill Bejeck bbejeck@apache.org

Currently, the test needs to wait for 45sec for session timeout to expire.
With a 60sec test timeout the test is flaky.

This PR let Kafka Streams send a leave group request on close()
which reduces the test runtime (for a single parameter run) from
about 50sec to 5sec.
@github-actions github-actions Bot added streams tests Test fixes (including flaky tests) small Small PRs labels Jul 14, 2026
@mjsax
mjsax merged commit 60144a7 into apache:trunk Jul 15, 2026
23 checks passed
@mjsax
mjsax deleted the kafka-20786-fix-test-utils branch July 15, 2026 21:51
kafkaStreams.close();
// Leave the group on close so the immediate restart below does not have to wait for the
// previous member to be evicted via session timeout (~45s) before its rebalance completes.
kafkaStreams.close(CloseOptions.groupMembershipOperation(GroupMembershipOperation.LEAVE_GROUP));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a good approach to reduce the elapsed time. We will file a patch for TimestampedStoreUpgradeIntegrationTest, which can reduce the elapsed time from 5m to 30s

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldMigrateInMemoryKeyValueStoreToTimestampedKeyValueStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldProxyWindowStoreToTimestampedWindowStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldMigratePersistentKeyValueStoreToTimestampedKeyValueStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldMigratePersistentWindowStoreToTimestampedWindowStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldSuccessfullyDowngradeFromTimestampedToRegularKeyValueStoreAfterCleanup() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldProxyKeyValueStoreToTimestampedKeyValueStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldMigrateInMemoryWindowStoreToTimestampedWindowStoreUsingPapi() PASSED

Gradle Test Run :streams:integration-tests:test > Gradle Test Executor 35 > TimestampedStoreUpgradeIntegrationTest > shouldFailDowngradeFromTimestampedToRegularKeyValueStore() PASSED

[Incubating] Problems report is available at: file:///home/chia7712/project/kafka/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.4.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 34s

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nileshkumar3 pushed a commit to nileshkumar3/kafka that referenced this pull request Jul 25, 2026
Currently, the test needs to wait for 45sec for session timeout to
expire. With a 60sec test timeout the test is flaky.

This PR let Kafka Streams send a leave group request on close() which
reduces the test runtime (for a single parameter run) from about 50sec
to 5sec.

Reviewers: Bill Bejeck <bbejeck@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants