check for deleted status before deleting to prevent spurious failures

This commit is contained in:
danikov 2011-11-16 19:04:31 +00:00
parent 6365190448
commit 3db6c66b1e
1 changed files with 4 additions and 1 deletions

View File

@ -68,8 +68,11 @@ public class NodeClientLiveTest extends BaseCloudLoadBalancersClientLiveTest {
protected void tearDown() { protected void tearDown() {
for (Entry<LoadBalancer, Set<Node>> entry : nodes.entrySet()) { for (Entry<LoadBalancer, Set<Node>> entry : nodes.entrySet()) {
LoadBalancer lb = entry.getKey(); LoadBalancer lb = entry.getKey();
LoadBalancerClient lbClient = client.getLoadBalancerClient(lb.getRegion());
client.getLoadBalancerClient(lb.getRegion()).removeLoadBalancer(lb.getId()); if(lbClient.getLoadBalancer(lb.getId()).getStatus() != Status.DELETED) {
lbClient.removeLoadBalancer(lb.getId());
}
assert loadBalancerDeleted.apply(lb) : lb; assert loadBalancerDeleted.apply(lb) : lb;
} }
super.tearDown(); super.tearDown();