diff --git a/src/test/java/org/elasticsearch/test/integration/AbstractNodesTests.java b/src/test/java/org/elasticsearch/test/integration/AbstractNodesTests.java index 9dff1f17a55..99d361408d4 100644 --- a/src/test/java/org/elasticsearch/test/integration/AbstractNodesTests.java +++ b/src/test/java/org/elasticsearch/test/integration/AbstractNodesTests.java @@ -100,6 +100,7 @@ public abstract class AbstractNodesTests extends ElasticsearchTestCase { Node node = nodeBuilder() .settings(finalSettings) .build(); + logger.info("Build Node [{}] with settings [{}]", id, finalSettings.toDelimitedString(',')); nodes.put(id, node); clients.put(id, node.client()); return node; diff --git a/src/test/java/org/elasticsearch/test/integration/gateway/fs/IndexGatewayTests.java b/src/test/java/org/elasticsearch/test/integration/gateway/fs/IndexGatewayTests.java index 234d601ff05..7768f8b10b1 100644 --- a/src/test/java/org/elasticsearch/test/integration/gateway/fs/IndexGatewayTests.java +++ b/src/test/java/org/elasticsearch/test/integration/gateway/fs/IndexGatewayTests.java @@ -53,6 +53,9 @@ import static org.hamcrest.Matchers.*; */ public class IndexGatewayTests extends AbstractNodesTests { + private Settings defaultSettings; + private String storeType; + @After public void closeNodes() throws Exception { node("server1").stop(); @@ -63,14 +66,38 @@ public class IndexGatewayTests extends AbstractNodesTests { @Before public void buildNode1() throws Exception { + super.setUp(); + Builder builder = ImmutableSettings.builder(); + builder.put("cluster.routing.schedule", "100ms"); + builder.put("gateway.type", "fs"); + if (between(0, 5) == 0) { + builder.put("gateway.fs.buffer_size", between(1, 100) + "kb"); + } + if (between(0, 5) == 0) { + builder.put("gateway.fs.chunk_size", between(1, 100) + "kb"); + } + + builder.put("index.number_of_replicas", "1"); + builder.put("index.number_of_shards", rarely() ? Integer.toString(between(2, 6)) : "1"); + storeType = rarely() ? "ram" : "fs"; + builder.put("index.store", storeType); + defaultSettings = builder.build(); buildNode("server1"); // since we store (by default) the index snapshot under the gateway, resetting it will reset the index data as well ((InternalNode) node("server1")).injector().getInstance(Gateway.class).reset(); closeAllNodes(); } - + @Override + protected final Settings getClassDefaultSettings() { + return defaultSettings; + } + protected boolean isPersistentStorage() { + assert storeType != null; + return "fs".equals(storeType); + } + @Test @Slow public void testSnapshotOperations() throws Exception { @@ -339,33 +366,6 @@ public class IndexGatewayTests extends AbstractNodesTests { testLoad(getRandom().nextBoolean()); } - private String storeType; - - @Override - protected final Settings getClassDefaultSettings() { - Builder builder = ImmutableSettings.builder(); - builder.put("cluster.routing.schedule", "100ms"); - builder.put("gateway.type", "fs"); - if (between(0, 5) == 0) { - builder.put("gateway.fs.buffer_size", between(1, 100) + "kb"); - } - if (between(0, 5) == 0) { - builder.put("gateway.fs.chunk_size", between(1, 100) + "kb"); - } - - builder.put("index.number_of_replicas", "1"); - builder.put("index.number_of_shards", rarely() ? Integer.toString(between(2, 6)) : "1"); - storeType = rarely() ? "ram" : "fs"; - builder.put("index.store", storeType); - return builder.build(); - } - - - protected boolean isPersistentStorage() { - return "fs".equals(storeType); - } - - @Test @Slow public void testIndexActions() throws Exception {