mirror of https://github.com/apache/jclouds.git
Retry loop did not increment the counter, so it would never actually terminate after repeated failures. Also decreased the number of attempts from 50 to 10, as 50 took too long to fail.
This commit is contained in:
parent
4def02f00e
commit
21105f8322
|
@ -89,13 +89,14 @@ public class LoadBalancerClientLiveTest extends BaseCloudStackClientLiveTest {
|
|||
if (networksDisabled)
|
||||
return;
|
||||
int attempts = 0;
|
||||
while (rule == null && attempts < 50) {
|
||||
while (rule == null && attempts < 10) {
|
||||
ip = reuseOrAssociate.apply(network);
|
||||
try {
|
||||
rule = client.getLoadBalancerClient().createLoadBalancerRuleForPublicIP(ip.getId(), Algorithm.LEASTCONN,
|
||||
prefix, 22, 22);
|
||||
} catch (IllegalStateException e) {
|
||||
// very likely an ip conflict, so retry;
|
||||
attempts++;
|
||||
}
|
||||
}
|
||||
assertNotNull(rule, "Failed to get a load balancer rule after "+attempts+" attempts");
|
||||
|
|
Loading…
Reference in New Issue