make index counter checking use assertBusy

This commit is contained in:
Boaz Leskes 2016-02-13 14:09:14 +01:00
parent 57501ce5ff
commit 63ada9882e
2 changed files with 13 additions and 3 deletions

View File

@ -138,6 +138,16 @@ public class DiscoveryWithServiceDisruptionsIT extends ESIntegTestCase {
return 1; return 1;
} }
@Override
protected void beforeIndexDeletion() {
try {
// some test may leave opeations in flight. Wait for them to be finnished
assertBusy(() -> super.beforeIndexDeletion());
} catch (Exception e) {
throw new AssertionError(e);
}
}
private List<String> startCluster(int numberOfNodes) throws ExecutionException, InterruptedException { private List<String> startCluster(int numberOfNodes) throws ExecutionException, InterruptedException {
return startCluster(numberOfNodes, -1); return startCluster(numberOfNodes, -1);
} }

View File

@ -308,8 +308,8 @@ public final class InternalTestCluster extends TestCluster {
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 5, 10)); builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 5, 10));
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 5, 10)); builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 5, 10));
} else if (random.nextInt(100) <= 90) { } else if (random.nextInt(100) <= 90) {
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 2, 5)); builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 2, 5));
builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 2, 5)); builder.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), RandomInts.randomIntBetween(random, 2, 5));
} }
// always reduce this - it can make tests really slow // always reduce this - it can make tests really slow
builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC_SETTING.getKey(), TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 50))); builder.put(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC_SETTING.getKey(), TimeValue.timeValueMillis(RandomInts.randomIntBetween(random, 20, 50)));
@ -554,7 +554,7 @@ public final class InternalTestCluster extends TestCluster {
logger.info("changing cluster size from {} to {}, {} data nodes", size(), n + numSharedClientNodes, n); logger.info("changing cluster size from {} to {}, {} data nodes", size(), n + numSharedClientNodes, n);
Set<NodeAndClient> nodesToRemove = new HashSet<>(); Set<NodeAndClient> nodesToRemove = new HashSet<>();
int numNodesAndClients = 0; int numNodesAndClients = 0;
while (values.hasNext() && numNodesAndClients++ < size-n) { while (values.hasNext() && numNodesAndClients++ < size - n) {
NodeAndClient next = values.next(); NodeAndClient next = values.next();
nodesToRemove.add(next); nodesToRemove.add(next);
removeDisruptionSchemeFromNode(next); removeDisruptionSchemeFromNode(next);