You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/12 21:48:43 UTC
[GitHub] [pulsar] merlimat opened a new pull request #10561: Fixed flakyness in LoadBalancerTest
merlimat opened a new pull request #10561:
URL: https://github.com/apache/pulsar/pull/10561
### Motivation
Recent change in the LoadManager has introduced flakyness in the LoadBalancertest. Fixed here by having more precise checking and retries.
--
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:
users@infra.apache.org
[GitHub] [pulsar] merlimat closed pull request #10561: Fixed flakyness in LoadBalancerTest
Posted by GitBox <gi...@apache.org>.
merlimat closed pull request #10561:
URL: https://github.com/apache/pulsar/pull/10561
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10561: Fixed flakyness in LoadBalancerTest
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org