Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ private CompletableFuture<Void> lookUpBrokerForTopic(TopicName partitionedTopicN
}

LookupResult result = optionalResult.get();
if (result.getLookupData().getHttpUrl().equals(pulsar().getWebServiceAddress())) {
if (result.getLookupData().getHttpUrl().equals(pulsar().getWebServiceAddress())
|| result.getLookupData().getHttpUrlTls().equals(pulsar().getWebServiceAddressTls())) {
Comment on lines -436 to +437

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.

Are you able to add a test to cover this behavior?

@tisonkun tisonkun Jun 8, 2023

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.

@michaeljmarshall The issue I encounter when trying to help with adding a test case is that it's not clear how to prepare a correct testenv setup for TLS REST client.

I try to copy org.apache.pulsar.broker.admin.TopicsTest#testProduceToPartitionedTopic and change the init logic as:

    @Override
    protected void doInitConf() throws Exception {
        super.doInitConf();
        this.conf.setBrokerServicePort(Optional.empty());
        this.conf.setWebServicePort(Optional.empty());
    }

But then the test case failed with SSL HANDSHAKE error or so.

Given that @maanders-tibco is a first-time contribution I wonder if you can share some backgrounds here for test cases we can refer to. Digging into the heavily mocked test suite can be quite disappointing.

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.

Sure that makes sense. I'll take a look at the code a bit closer to make sure I understand the change and then we can merge it.

// Current broker owns the topic, add to owning topic.
if (log.isDebugEnabled()) {
log.debug("Complete topic look up for rest produce message request for topic {}, "
Expand Down