Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] [broker] response not-found error if topic does not exist when calling getPartitionedTopicMetadata #22838

Merged
merged 20 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a test case: topic with suffix -partition-1
  • Loading branch information
poorbarcode committed Jun 11, 2024
commit f0677a9e0e4c2d695b07b5e54c7fbb52d9b09f16
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,15 @@ public void testAutoCreatePartitionedTopic(boolean isUsingHttpLookup, TopicDomai
final String topicNameStrWithSuffix = BrokerTestUtil.newUniqueName(
topicDomain.value() + "://" + DEFAULT_NS + "/tp") + "-partition-1";
// Verify: the result of get partitioned topic metadata.
PartitionedTopicMetadata responseWithSuffix =
PartitionedTopicMetadata response2 =
client.getPartitionedTopicMetadata(topicNameStrWithSuffix, true).join();
assertEquals(responseWithSuffix.partitions, 0);
assertEquals(response2.partitions, 0);
// Verify: the behavior of topic creation.
List<String> partitionedTopicsWithSuffix =
List<String> partitionedTopics2 =
admin1.topics().getPartitionedTopicList("public/default");
assertFalse(partitionedTopicsWithSuffix.contains(topicNameStrWithSuffix));
assertFalse(partitionedTopics2.contains(topicNameStrWithSuffix));
assertFalse(partitionedTopics2.contains(
TopicName.get(topicNameStrWithSuffix).getPartitionedTopicName()));

// Verify: lookup semaphore has been releases.
Awaitility.await().untilAsserted(() -> {
Expand Down Expand Up @@ -389,13 +391,15 @@ public void testAutoCreateNonPartitionedTopic(boolean isUsingHttpLookup, TopicDo
final String topicNameStrWithSuffix = BrokerTestUtil.newUniqueName(
topicDomain.value() + "://" + DEFAULT_NS + "/tp") + "-partition-1";
// Verify: the result of get partitioned topic metadata.
PartitionedTopicMetadata responseWithSuffix =
PartitionedTopicMetadata response2 =
client.getPartitionedTopicMetadata(topicNameStrWithSuffix, true).join();
assertEquals(responseWithSuffix.partitions, 0);
assertEquals(response2.partitions, 0);
// Verify: the behavior of topic creation.
List<String> partitionedTopicsWithSuffix =
List<String> partitionedTopics2 =
admin1.topics().getPartitionedTopicList("public/default");
assertFalse(partitionedTopicsWithSuffix.contains(topicNameStrWithSuffix));
assertFalse(partitionedTopics2.contains(topicNameStrWithSuffix));
assertFalse(partitionedTopics2.contains(
TopicName.get(topicNameStrWithSuffix).getPartitionedTopicName()));

// Verify: lookup semaphore has been releases.
Awaitility.await().untilAsserted(() -> {
Expand Down