Skip to content

KAFKA-14919 sync topic configs test#16143

Closed
anton-liauchuk wants to merge 1 commit intoapache:trunkfrom
anton-liauchuk:KAFKA-14919
Closed

KAFKA-14919 sync topic configs test#16143
anton-liauchuk wants to merge 1 commit intoapache:trunkfrom
anton-liauchuk:KAFKA-14919

Conversation

@anton-liauchuk
Copy link
Copy Markdown
Contributor

KAFKA-14919 sync topic configs test

@anton-liauchuk
Copy link
Copy Markdown
Contributor Author

@gharris1727

Please take a look.

@gharris1727
Copy link
Copy Markdown
Contributor

Hi @anton-liauchuk Thanks for the PR!

Is the KAFKA ticket linked the right one? I don't think this implementation matches the description of that ticket. I expected changes to the FakeLocalMetadataStore to be necessary.

@gharris1727 gharris1727 added tests Test fixes (including flaky tests) mirror-maker-2 labels May 30, 2024
@anton-liauchuk
Copy link
Copy Markdown
Contributor Author

anton-liauchuk commented Jun 10, 2024

@gharris1727

Hi @anton-liauchuk Thanks for the PR!

Is the KAFKA ticket linked the right one? I don't think this implementation matches the description of that ticket. I expected changes to the FakeLocalMetadataStore to be necessary.

From the task description:

These tests and/or the metadata store should be changed so that the tests are isolated from one another, and actually perform the assertions that correspond to their titles.

I made changes to the tests to ensure they assert a specific operation. Before my changes, the test
org.apache.kafka.connect.mirror.integration.MirrorConnectorsWithCustomForwardingAdminIntegrationTest#testReplicationIsCreatingTopicsUsingProvidedForwardingAdmin might have passed due to refresh.topics.enabled flag and related configuration. After the new changes, this test asserts the behavior of org.apache.kafka.connect.mirror.MirrorSourceConnector#computeAndCreateTopicPartitions without depending on other functionality.

The test org.apache.kafka.connect.mirror.integration.MirrorConnectorsWithCustomForwardingAdminIntegrationTest#testSyncTopicConfigUseProvidedForwardingAdmin did not properly check the sync functionality because there were no configs for the topic and no related assertions. With the recent changes, I updated the test to check the retention.bytes config to ensure that it was properly synced. To accomplish this, I had to implement org.apache.kafka.connect.mirror.clients.admin.FakeForwardingAdminWithLocalMetadata#incrementalAlterConfigs to store new configs during the sync.

For now, it seems that these two tests were the main issue in this test class. With the new changes, each test will assert only one particular functionality. Do you think we should also change the metadata store?

@gharris1727
Copy link
Copy Markdown
Contributor

Okay thank you for the clarification @anton-liauchuk . While avoiding confusing one operation for another by turning off all-but-one operation avoids the ambiguity, it still leaves the opportunity for ambiguity to appear in the future. If we are avoiding certain situations due to ambiguity, that reduces our total test coverage.

Also I think testCreatePartitionsUseProvidedForwardingAdmin remains ambiguous, at least from re-reading my original comment: #13575 (comment)

I had to implement incrementalAlterConfigs

Thanks, that definitely needed to be done. FakeLocalMetadataStore should have the granularity to assert that we used incremental vs the legacy API, and it doesn't right now. That would have caught this mistake earlier when MM2 support for the new API was added.

Please refactor the FakeLocalMetadata store to make the ambiguity impossible, thanks!

@anton-liauchuk anton-liauchuk force-pushed the KAFKA-14919 branch 2 times, most recently from 4cd3a5d to 007caeb Compare July 28, 2024 17:47
@anton-liauchuk
Copy link
Copy Markdown
Contributor Author

@gharris1727

Please take a look.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2025

This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

@github-actions github-actions Bot added the stale Stale PRs label Jan 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 2025

This PR has been closed since it has not had any activity in 120 days. If you feel like this
was a mistake, or you would like to continue working on it, please feel free to re-open the
PR and ask for a review.

@github-actions github-actions Bot added the closed-stale PRs that were closed due to inactivity label Feb 5, 2025
@github-actions github-actions Bot closed this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-stale PRs that were closed due to inactivity mirror-maker-2 stale Stale PRs tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants