lhotari commented on a change in pull request #10561:
URL: https://github.com/apache/pulsar/pull/10561#discussion_r631654899
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
##########
@@ -312,30 +312,46 @@ public void testBrokerRanking() throws Exception {
sru.setCpu(new ResourceUsage(60, 400));
lr.setSystemResourceUsage(sru);
+ double percentUsageMem = 100 * sru.getMemory().usage /
sru.getMemory().limit;
+ double percentUsageCpu = 100 * sru.getCpu().usage /
sru.getCpu().limit;
+ log.info("Broker-{} - Resource usage: {}", i,
Math.max(percentUsageMem, percentUsageCpu));
+
ResourceLock<LoadReport> lock =
Whitebox.getInternalState(pulsarServices[i].getLoadManager().get(),
"brokerLock");
lock.updateValue(lr).join();
}
for (int i = 0; i < BROKER_COUNT; i++) {
Method updateRanking =
Whitebox.getMethod(SimpleLoadManagerImpl.class, "updateRanking");
- updateRanking.invoke(pulsarServices[0].getLoadManager().get());
+ updateRanking.invoke(pulsarServices[i].getLoadManager().get());
Review comment:
A similar bug is also in many other test methods in LoadBalancerTest.
Please check.
--
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]