Skip to content

Commit

Permalink
pass on node seed to the node level settings in TestCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Jan 3, 2014
1 parent 49d0ced commit 602c63d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/java/org/elasticsearch/test/TestCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ public final class TestCluster implements Iterable<Client> {
*/
public static final String TESTS_ENABLE_MOCK_MODULES = "tests.enable_mock_modules";

/**
* A node level setting that holds a per node random seed that is consistent across node restarts
*/
public static final String SETTING_CLUSTER_NODE_SEED = "test.cluster.node.seed";


private static final boolean ENABLE_MOCK_MODULES = systemPropertyAsBoolean(TESTS_ENABLE_MOCK_MODULES, true);

private static long clusterSeed() {
Expand Down Expand Up @@ -205,7 +211,8 @@ private static Settings getRandomNodeSettings(long seed, String clusterName) {
// decrease the routing schedule so new nodes will be added quickly - some random value between 30 and 80 ms
.put("cluster.routing.schedule", (30 + random.nextInt(50)) + "ms")
// default to non gateway
.put("gateway.type", "none");
.put("gateway.type", "none")
.put(SETTING_CLUSTER_NODE_SEED, seed);
if (ENABLE_MOCK_MODULES && usually(random)) {
builder.put("index.store.type", MockFSIndexStoreModule.class.getName()); // no RAM dir for now!
builder.put(IndexEngineModule.EngineSettings.ENGINE_TYPE, MockEngineModule.class.getName());
Expand Down

0 comments on commit 602c63d

Please sign in to comment.