kezhuw commented on a change in pull request #10165:
URL: https://github.com/apache/pulsar/pull/10165#discussion_r611203956



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicOwnerTest.java
##########
@@ -434,13 +477,22 @@ public void 
testReleaseOwnershipWithZookeeperDisconnectedBeforeOwnershipNodeDele
         leaderAuthorizedBroker.setValue(pulsar2);
 
         // We don't known whether previous unload was successful or not, but 
now all lookups should return same result.
-        final String currentBrokerServiceUrl = 
pulsarAdmins[0].lookups().lookupTopic(topic1);
-        Assert.assertEquals(pulsarAdmins[1].lookups().lookupTopic(topic1), 
currentBrokerServiceUrl);
-        Assert.assertEquals(pulsarAdmins[2].lookups().lookupTopic(topic1), 
currentBrokerServiceUrl);
-        Assert.assertEquals(pulsarAdmins[3].lookups().lookupTopic(topic1), 
currentBrokerServiceUrl);
-        Assert.assertEquals(pulsarAdmins[4].lookups().lookupTopic(topic1), 
currentBrokerServiceUrl);
+        final String ownerBrokerServiceUrl = 
pulsarAdmins[0].lookups().lookupTopic(topic1);
+        Assert.assertEquals(pulsarAdmins[1].lookups().lookupTopic(topic1), 
ownerBrokerServiceUrl);
+        Assert.assertEquals(pulsarAdmins[2].lookups().lookupTopic(topic1), 
ownerBrokerServiceUrl);
+        Assert.assertEquals(pulsarAdmins[3].lookups().lookupTopic(topic1), 
ownerBrokerServiceUrl);
+        Assert.assertEquals(pulsarAdmins[4].lookups().lookupTopic(topic1), 
ownerBrokerServiceUrl);
 
         pulsarAdmins[0].topics().createNonPartitionedTopic(topic1);
+
+        for (Map.Entry<String, MutableBoolean> entry : 
loadedFromListenersByBrokerUrl.entrySet()) {
+            String brokerUrl = entry.getKey();
+            PulsarService service = servicesByBrokerUrl.get(brokerUrl);
+            MutableBoolean loadedFromListener = entry.getValue();
+            boolean owned = brokerUrl.equals(ownerBrokerServiceUrl);
+            
Assert.assertEquals(service.getNamespaceService().isServiceUnitOwned(namespaceBundle),
 owned);
+            Assert.assertEquals(entry.getValue().booleanValue(), owned);

Review comment:
       ```suggestion
               Assert.assertEquals(loadedFromListener.booleanValue(), owned);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to