[TEST] Only create indices if nodes exist

Some tests manually start nodes, hence in the before test phase there are no nodes around thus indices should not be created.
Relates to elastic/elasticsearch#3770

Closes elastic/elasticsearch#3812

Original commit: elastic/x-pack-elasticsearch@a21ad39903
This commit is contained in:
javanna 2016-10-19 18:15:51 +02:00 committed by Luca Cavanna
parent 3d658c3f1e
commit a4c0c49b43
1 changed files with 31 additions and 29 deletions

View File

@ -323,6 +323,7 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
*
*/
private void configureAliasesForWatcherIndices() throws Exception {
if (internalCluster().size() > 0) {
// alias for .watches, setting the index template to the same as well
if (rarely()) {
String newIndex = ".watches-alias-index";
@ -359,6 +360,7 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
}
}
}
}
protected TimeWarp timeWarp() {
assert timeWarped() : "cannot access TimeWarp when test context is not time warped";