lhotari commented on code in PR #21894:
URL: https://github.com/apache/pulsar/pull/21894#discussion_r1451784522
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java:
##########
@@ -272,10 +272,9 @@ public void testPrimary() throws Exception {
sortedRankingsInstance.get().put(lr.getRank(rd), rus);
setObjectField(SimpleLoadManagerImpl.class, loadManager,
"sortedRankings", sortedRankingsInstance);
- final Optional<ResourceUnit> leastLoaded =
loadManager.getLeastLoaded(NamespaceName.get("pulsar/use/primary-ns.10"));
- // broker is not active so found should be null
- assertFalse(leastLoaded.isPresent());
-
+ ResourceUnit found =
loadManager.getLeastLoaded(NamespaceName.get("pulsar/use/primary-ns.10")).get();
+ // TODO: this test doesn't make sense. This was the original assertion.
+ assertNotEquals(found, null, "did not find a broker when expected one
to be found");
Review Comment:
Yes. It was changed in this PR
https://github.com/apache/pulsar/pull/21633/files#diff-035563de8827b9962ac5895d1620df983e7e11116d2f66eb9dc3adde10dfd991L262
. I simply reverted that change. One detail is that the original comment was
wrong.
The test is probably not valid itself.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]