Skip to content

MINOR: Add test case for topic recreation with collision chars#12796

Merged
hachikuji merged 2 commits intoapache:trunkfrom
hachikuji:minor-test-case-follow-up-kafka-14337
Oct 29, 2022
Merged

MINOR: Add test case for topic recreation with collision chars#12796
hachikuji merged 2 commits intoapache:trunkfrom
hachikuji:minor-test-case-follow-up-kafka-14337

Conversation

@hachikuji
Copy link
Copy Markdown
Contributor

This patch adds a unit test for topic recreation with colliding characters (such as .). This was broken up until #12790.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Copy Markdown
Member

@jsancio jsancio left a comment

Choose a reason for hiding this comment

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

Thanks @hachikuji. LGTM if the tests are green.

Comment on lines +718 to +730
public void testCreateTopicWithCollisionChars() throws Exception {
ReplicationControlTestContext ctx = new ReplicationControlTestContext(Optional.empty());
ctx.registerBrokers(0, 1, 2);
ctx.unfenceBrokers(0, 1, 2);

CreatableTopicResult initialTopic = ctx.createTestTopic("foo.bar", 2, (short) 2, NONE.code());
assertEquals(2, ctx.replicationControl.getTopic(initialTopic.topicId()).numPartitions(Long.MAX_VALUE));
ctx.deleteTopic(initialTopic.topicId());

CreatableTopicResult recreatedTopic = ctx.createTestTopic("foo.bar", 4, (short) 2, NONE.code());
assertNotEquals(initialTopic.topicId(), recreatedTopic.topicId());
assertEquals(4, ctx.replicationControl.getTopic(recreatedTopic.topicId()).numPartitions(Long.MAX_VALUE));
}
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.

Does this test fail against trunk prior to merging #12790?

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, it does.

@hachikuji hachikuji merged commit cbe50d9 into apache:trunk Oct 29, 2022
@showuon
Copy link
Copy Markdown
Member

showuon commented Oct 31, 2022

Thanks for helping adding the tests, @hachikuji !

guozhangwang pushed a commit to guozhangwang/kafka that referenced this pull request Jan 25, 2023
…e#12796)

This patch adds a unit test for topic recreation with colliding characters (such as `.`). This was broken up until apache#12790. 

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>
rutvijmehta-harness pushed a commit to rutvijmehta-harness/kafka that referenced this pull request Feb 9, 2024
…e#12796)

This patch adds a unit test for topic recreation with colliding characters (such as `.`). This was broken up until apache#12790. 

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>
rutvijmehta-harness added a commit to rutvijmehta-harness/kafka that referenced this pull request Feb 9, 2024
…e#12796) (#91)

This patch adds a unit test for topic recreation with colliding characters (such as `.`). This was broken up until apache#12790. 

Reviewers: José Armando García Sancio <jsancio@users.noreply.github.com>

Co-authored-by: Jason Gustafson <jason@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants