[TEST] apply default settings by calling super.nodeSettings method when providing test specific methods

This commit is contained in:
javanna 2014-08-28 15:10:24 +02:00 committed by Luca Cavanna
parent a0e9532dca
commit 88839ec546
12 changed files with 23 additions and 14 deletions

View File

@ -46,6 +46,7 @@ public class RejectionActionTests extends ElasticsearchIntegrationTest {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put("threadpool.search.size", 1)
.put("threadpool.search.queue_size", 1)
.put("threadpool.index.size", 1)

View File

@ -67,16 +67,18 @@ public class BenchmarkIntegrationTest extends ElasticsearchIntegrationTest {
protected synchronized Settings nodeSettings(int nodeOrdinal) {
if (nodeOrdinal == 0) { // at least one
return ImmutableSettings.builder().put("node.bench", true).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("node.bench", true).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
} else {
if (benchNodes.containsKey(nodeOrdinal)) {
return ImmutableSettings.builder().put("node.bench", benchNodes.get(nodeOrdinal)).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("node.bench", benchNodes.get(nodeOrdinal)).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
} else {
boolean b = randomBoolean();
benchNodes.put(nodeOrdinal, b);
return ImmutableSettings.builder().put("node.bench", b).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("node.bench", b).put(GroovyScriptEngineService.GROOVY_SCRIPT_SANDBOX_ENABLED, false).build();
}
}
}

View File

@ -38,7 +38,8 @@ public class BenchmarkNegativeTest extends ElasticsearchIntegrationTest {
private static final String INDEX_NAME = "test_index";
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder().put("node.bench", false).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put("node.bench", false).build();
}
@Test(expected = BenchmarkNodeMissingException.class)

View File

@ -48,6 +48,7 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest
//to test that the acknowledgement mechanism is working we better disable the wait for publish
//otherwise the operation is most likely acknowledged even if it doesn't support ack
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(DiscoverySettings.PUBLISH_TIMEOUT, 0)
//make sure that enough concurrent reroutes can happen at the same time
//we have a minimum of 2 nodes, and a maximum of 10 shards, thus 5 should be enough

View File

@ -63,7 +63,8 @@ public class AckTests extends ElasticsearchIntegrationTest {
protected Settings nodeSettings(int nodeOrdinal) {
//to test that the acknowledgement mechanism is working we better disable the wait for publish
//otherwise the operation is most likely acknowledged even if it doesn't support ack
return ImmutableSettings.builder().put(DiscoverySettings.PUBLISH_TIMEOUT, 0).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put(DiscoverySettings.PUBLISH_TIMEOUT, 0).build();
}
@Test

View File

@ -40,9 +40,9 @@ public class ClusterSearchShardsTests extends ElasticsearchIntegrationTest {
protected Settings nodeSettings(int nodeOrdinal) {
switch(nodeOrdinal) {
case 1:
return settingsBuilder().put("node.tag", "B").build();
return settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("node.tag", "B").build();
case 0:
return settingsBuilder().put("node.tag", "A").build();
return settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("node.tag", "A").build();
}
return super.nodeSettings(nodeOrdinal);
}

View File

@ -19,9 +19,7 @@
package org.elasticsearch.index.query;
import com.google.common.collect.Maps;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.indexedscripts.delete.DeleteIndexedScriptResponse;
import org.elasticsearch.action.indexedscripts.get.GetIndexedScriptResponse;
import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptResponse;
@ -66,7 +64,8 @@ public class TemplateQueryTest extends ElasticsearchIntegrationTest {
@Override
public Settings nodeSettings(int nodeOrdinal) {
return settingsBuilder().put("path.conf", this.getResource("config").getPath()).build();
return settingsBuilder().put(super.nodeSettings(nodeOrdinal))
.put("path.conf", this.getResource("config").getPath()).build();
}
@Test

View File

@ -65,7 +65,7 @@ public class RecoveryPercolatorTests extends ElasticsearchIntegrationTest {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return builder().put("gateway.type", "local").build();
return builder().put(super.nodeSettings(nodeOrdinal)).put("gateway.type", "local").build();
}
@Test

View File

@ -40,7 +40,8 @@ public class OnDiskScriptTests extends ElasticsearchIntegrationTest {
@Override
public Settings nodeSettings(int nodeOrdinal) {
//Set path so ScriptService will pick up the test scripts
return settingsBuilder().put("path.conf", this.getResource("config").getPath()).build();
return settingsBuilder().put(super.nodeSettings(nodeOrdinal))
.put("path.conf", this.getResource("config").getPath()).build();
}

View File

@ -42,7 +42,8 @@ public class StressSearchServiceReaperTest extends ElasticsearchIntegrationTest
@Override
protected Settings nodeSettings(int nodeOrdinal) {
// very frequent checks
return ImmutableSettings.builder().put(SearchService.KEEPALIVE_INTERVAL_KEY, TimeValue.timeValueMillis(1)).build();
return ImmutableSettings.builder().put(super.nodeSettings(nodeOrdinal))
.put(SearchService.KEEPALIVE_INTERVAL_KEY, TimeValue.timeValueMillis(1)).build();
}
@Slow

View File

@ -56,6 +56,7 @@ public class DateHistogramOffsetTests extends ElasticsearchIntegrationTest {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(AssertingLocalTransport.ASSERTING_TRANSPORT_MIN_VERSION_KEY, Version.V_1_4_0).build();
}

View File

@ -51,6 +51,7 @@ public abstract class ShardSizeTests extends ElasticsearchIntegrationTest {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put("cluster.routing.operation.hash.type", "djb")
.put("cluster.routing.operation.use_type", "false")
.build();