Skip to content

KAFKA-20689: Migrate reset integration tests to ClusterInstance#22579

Open
Russole wants to merge 8 commits into
apache:trunkfrom
Russole:KAFKA-20689
Open

KAFKA-20689: Migrate reset integration tests to ClusterInstance#22579
Russole wants to merge 8 commits into
apache:trunkfrom
Russole:KAFKA-20689

Conversation

@Russole

@Russole Russole commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Migrate the reset integration tests in the tools module to use
ClusterInstance.

The tools module previously depended on Streams integration test
utilities through test outputs. Those utilities still use Hamcrest, so
removing the explicit Hamcrest runtime dependency from tools exposed
an indirect runtime dependency.

Instead of changing IntegrationTestUtils, this patch updates
ResetIntegrationTest and ResetIntegrationWithSslTest to use the
Kafka common test cluster framework directly. The reset tests now keep
local copies of the small subset of test utility behavior they need,
staying as close as possible to the original IntegrationTestUtils and
EmbeddedKafkaCluster semantics while removing the dependency from
tools.

This allows the unnecessary Hamcrest test runtime dependency to be
removed from the tools module.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

Testing

./gradlew --no-daemon :tools:test -PmaxParallelForks=1

@github-actions github-actions Bot added triage PRs from the community streams build Gradle build or GitHub Actions small Small PRs labels Jun 15, 2026
readRecords(topic, consumer, waitTime, expectedNumRecords);
accumData.addAll(readData);
assertThat(reason, accumData.size(), is(greaterThanOrEqualTo(expectedNumRecords)));
assertTrue(accumData.size() >= expectedNumRecords, reason);

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.

Would you mind removing those unrelated changes?

@Russole Russole Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @chia7712 for the review. I can remove the IntegrationTestUtils changes.

One thing I noticed locally is that if I revert those changes but still remove Hamcrest from tools, :tools:test fails with NoClassDefFoundError: org/hamcrest/Matchers.

So even though tools does not use Hamcrest directly, some tools tests call IntegrationTestUtils from the Streams integration tests, and that class still uses Hamcrest. That means tools still needs Hamcrest indirectly unless we also remove the Hamcrest usage there.

For example, these tests fail after reverting the IntegrationTestUtils change:

  • ResetIntegrationWithSslTest.testReprocessingFromScratchAfterResetWithIntermediateInternalTopic
  • ResetIntegrationWithSslTest.testReprocessingFromScratchAfterResetWithIntermediateUserTopic
  • ResetIntegrationWithSslTest.testReprocessingFromScratchAfterResetWithoutIntermediateUserTopic
  • ResetIntegrationWithSslTest.testResetWhenInternalTopicsAreSpecified

Do you prefer that I keep the IntegrationTestUtils change in this PR, or should I leave the tools Hamcrest dependency as-is?

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.

Could we rewrite both ResetIntegrationTest and ResetIntegrationWithSslTest using ClusterInstance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that makes sense. I’ll look into migrating ResetIntegrationTest and ResetIntegrationWithSslTest to ClusterInstance so we can keep the dependency cleanup scoped to tools instead of changing IntegrationTestUtils.

@Russole Russole marked this pull request as draft June 15, 2026 18:00
@github-actions github-actions Bot removed the triage PRs from the community label Jun 16, 2026
@github-actions github-actions Bot added tools and removed small Small PRs labels Jun 19, 2026
@Russole Russole changed the title MINOR: Remove unnecessary Hamcrest dependency from tools module KAFKA-20689: Migrate reset integration tests to ClusterInstance Jun 19, 2026
@Russole Russole marked this pull request as ready for review June 19, 2026 10:48
@Russole Russole requested a review from chia7712 June 19, 2026 10:48
@Russole Russole marked this pull request as draft June 19, 2026 10:48
@Russole Russole marked this pull request as ready for review June 20, 2026 03:19
@Russole Russole marked this pull request as draft June 20, 2026 03:24
@Russole Russole marked this pull request as ready for review June 20, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions ci-approved streams tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants