mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
[TEST] Wait for cluster consistency before tests starts
This commit is contained in:
parent
b9a09c2b06
commit
97793358ea
@ -209,6 +209,7 @@ public class BasicBackwardsCompatibilityTest extends ElasticsearchBackwardsCompa
|
||||
@Test
|
||||
public void testIndexUpgradeSingleNode() throws Exception {
|
||||
assertAcked(prepareCreate("test").setSettings(ImmutableSettings.builder().put("index.routing.allocation.exclude._name", backwardsCluster().newNodePattern()).put(indexSettings())));
|
||||
ensureYellow();
|
||||
int numDocs = randomIntBetween(100, 150);
|
||||
IndexRequestBuilder[] docs = new IndexRequestBuilder[numDocs];
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
@ -222,7 +223,7 @@ public class BasicBackwardsCompatibilityTest extends ElasticsearchBackwardsCompa
|
||||
CountResponse countResponse = client().prepareCount().get();
|
||||
assertHitCount(countResponse, numDocs);
|
||||
backwardsCluster().upgradeOneNode();
|
||||
ensureYellow("test");
|
||||
ensureYellow();
|
||||
if (randomBoolean()) {
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
docs[i] = client().prepareIndex("test", "type1", String.valueOf(i)).setSource("field1", English.intToEnglish(i));
|
||||
|
@ -75,6 +75,9 @@ public class CompositeTestCluster extends TestCluster {
|
||||
}
|
||||
externalNodes[i].reset(random.nextLong());
|
||||
}
|
||||
if (size() > 0) {
|
||||
client().admin().cluster().prepareHealth().setWaitForNodes(">=" + Integer.toString(this.size())).get();
|
||||
}
|
||||
}
|
||||
|
||||
private Collection<ExternalNode> runningNodes() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user