Skip to content

Conversation

shashankhs11
Copy link
Contributor

@shashankhs11 shashankhs11 commented Sep 7, 2025

Clean up RestoreIntegrationTest.java

Reviewers: Lucas Brutschy [email protected]

@github-actions github-actions bot added triage PRs from the community streams tests Test fixes (including flaky tests) small Small PRs labels Sep 7, 2025
@lucasbru lucasbru self-assigned this Sep 8, 2025
@lucasbru lucasbru requested a review from Copilot September 8, 2025 07:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up integration tests related to state-updater by removing the state-updater parameterization from test methods in RestoreIntegrationTest.java. The changes simplify the test structure by removing the state-updater enabled/disabled testing matrix while maintaining coverage for the new protocol parameter.

  • Removed state-updater parameterization from all test methods
  • Simplified test method signatures and property configuration
  • Cleaned up unused imports related to state-updater configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -161,8 +159,8 @@ public void createTopics(final TestInfo testInfo) throws InterruptedException {
CLUSTER.createTopic(inputStream, 2, 1);
}

private Properties props(final boolean stateUpdaterEnabled) {
return props(mkObjectProperties(mkMap(mkEntry(InternalConfig.STATE_UPDATER_ENABLED, stateUpdaterEnabled))));
private Properties props() {
Copy link
Preview

Copilot AI Sep 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The props() method now creates an empty map which might be confusing. Consider adding a comment explaining that this method creates default properties without additional state-updater configuration, or rename it to defaultProps() for clarity.

Suggested change
private Properties props() {
/**
* Creates default properties for a Streams application without additional state-updater configuration.
*/
private Properties defaultProps() {

Copilot uses AI. Check for mistakes.

@shashankhs11 shashankhs11 changed the title KAFKA-19666: Clean up integration tests related to state-updater KAFKA-19666: Remove old restoration codepath from RestoreIntegrationTest [4/N] Sep 8, 2025
@github-actions github-actions bot removed the triage PRs from the community label Sep 9, 2025
Copy link
Contributor

@apalan60 apalan60 left a comment

Choose a reason for hiding this comment

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

@shashankhs11

Thanks for the patch.
Overall LGTM, just a small nit.

@@ -537,7 +510,7 @@ public void shouldProcessDataFromStoresWithLoggingDisabled(final boolean stateUp

final Topology topology = streamsBuilder.build();

final Properties props = props(stateUpdaterEnabled);
final Properties props = props();

if (useNewProtocol) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I noticed a few repeated snippets like

if (useNewProtocol) {
        props.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name());
    }

Maybe it could be helpful to add small overloads

private Properties props(final boolean useNewProtocol) {
    return props(mkObjectProperties(mkMap()), useNewProtocol);
}

private Properties props(final Properties extraProperties, final boolean useNewProtocol) {
    final Properties streamsConfiguration = props(extraProperties);
    if (useNewProtocol) {
        streamsConfiguration.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name());
    }
    return streamsConfiguration;
}

Then call sites could just use props(useNewProtocol) or props(extra, useNewProtocol) to reduce the repeated if blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved small Small PRs streams tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants