[TEST] apply default settings by calling super.nodeSettings method when providing test specific methods
This commit is contained in:
parent
a0e9532dca
commit
88839ec546
|
@ -46,6 +46,7 @@ public class RejectionActionTests extends ElasticsearchIntegrationTest {
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return ImmutableSettings.builder()
|
return ImmutableSettings.builder()
|
||||||
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put("threadpool.search.size", 1)
|
.put("threadpool.search.size", 1)
|
||||||
.put("threadpool.search.queue_size", 1)
|
.put("threadpool.search.queue_size", 1)
|
||||||
.put("threadpool.index.size", 1)
|
.put("threadpool.index.size", 1)
|
||||||
|
|
|
@ -67,16 +67,18 @@ public class BenchmarkIntegrationTest extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
protected synchronized Settings nodeSettings(int nodeOrdinal) {
|
protected synchronized Settings nodeSettings(int nodeOrdinal) {
|
||||||
if (nodeOrdinal == 0) { // at least one
|
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 {
|
} else {
|
||||||
if (benchNodes.containsKey(nodeOrdinal)) {
|
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 {
|
} else {
|
||||||
boolean b = randomBoolean();
|
boolean b = randomBoolean();
|
||||||
benchNodes.put(nodeOrdinal, b);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,8 @@ public class BenchmarkNegativeTest extends ElasticsearchIntegrationTest {
|
||||||
private static final String INDEX_NAME = "test_index";
|
private static final String INDEX_NAME = "test_index";
|
||||||
|
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
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)
|
@Test(expected = BenchmarkNodeMissingException.class)
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest
|
||||||
//to test that the acknowledgement mechanism is working we better disable the wait for publish
|
//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
|
//otherwise the operation is most likely acknowledged even if it doesn't support ack
|
||||||
return ImmutableSettings.builder()
|
return ImmutableSettings.builder()
|
||||||
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(DiscoverySettings.PUBLISH_TIMEOUT, 0)
|
.put(DiscoverySettings.PUBLISH_TIMEOUT, 0)
|
||||||
//make sure that enough concurrent reroutes can happen at the same time
|
//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
|
//we have a minimum of 2 nodes, and a maximum of 10 shards, thus 5 should be enough
|
||||||
|
|
|
@ -63,7 +63,8 @@ public class AckTests extends ElasticsearchIntegrationTest {
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
//to test that the acknowledgement mechanism is working we better disable the wait for publish
|
//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
|
//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
|
@Test
|
||||||
|
|
|
@ -40,9 +40,9 @@ public class ClusterSearchShardsTests extends ElasticsearchIntegrationTest {
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
switch(nodeOrdinal) {
|
switch(nodeOrdinal) {
|
||||||
case 1:
|
case 1:
|
||||||
return settingsBuilder().put("node.tag", "B").build();
|
return settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("node.tag", "B").build();
|
||||||
case 0:
|
case 0:
|
||||||
return settingsBuilder().put("node.tag", "A").build();
|
return settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("node.tag", "A").build();
|
||||||
}
|
}
|
||||||
return super.nodeSettings(nodeOrdinal);
|
return super.nodeSettings(nodeOrdinal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
package org.elasticsearch.index.query;
|
package org.elasticsearch.index.query;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.elasticsearch.ElasticsearchException;
|
|
||||||
import org.elasticsearch.action.index.IndexRequestBuilder;
|
import org.elasticsearch.action.index.IndexRequestBuilder;
|
||||||
import org.elasticsearch.action.index.IndexResponse;
|
|
||||||
import org.elasticsearch.action.indexedscripts.delete.DeleteIndexedScriptResponse;
|
import org.elasticsearch.action.indexedscripts.delete.DeleteIndexedScriptResponse;
|
||||||
import org.elasticsearch.action.indexedscripts.get.GetIndexedScriptResponse;
|
import org.elasticsearch.action.indexedscripts.get.GetIndexedScriptResponse;
|
||||||
import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptResponse;
|
import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptResponse;
|
||||||
|
@ -66,7 +64,8 @@ public class TemplateQueryTest extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Settings nodeSettings(int nodeOrdinal) {
|
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
|
@Test
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class RecoveryPercolatorTests extends ElasticsearchIntegrationTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return builder().put("gateway.type", "local").build();
|
return builder().put(super.nodeSettings(nodeOrdinal)).put("gateway.type", "local").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -40,7 +40,8 @@ public class OnDiskScriptTests extends ElasticsearchIntegrationTest {
|
||||||
@Override
|
@Override
|
||||||
public Settings nodeSettings(int nodeOrdinal) {
|
public Settings nodeSettings(int nodeOrdinal) {
|
||||||
//Set path so ScriptService will pick up the test scripts
|
//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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ public class StressSearchServiceReaperTest extends ElasticsearchIntegrationTest
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
// very frequent checks
|
// 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
|
@Slow
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class DateHistogramOffsetTests extends ElasticsearchIntegrationTest {
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return ImmutableSettings.builder()
|
return ImmutableSettings.builder()
|
||||||
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put(AssertingLocalTransport.ASSERTING_TRANSPORT_MIN_VERSION_KEY, Version.V_1_4_0).build();
|
.put(AssertingLocalTransport.ASSERTING_TRANSPORT_MIN_VERSION_KEY, Version.V_1_4_0).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ public abstract class ShardSizeTests extends ElasticsearchIntegrationTest {
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
return ImmutableSettings.builder()
|
return ImmutableSettings.builder()
|
||||||
|
.put(super.nodeSettings(nodeOrdinal))
|
||||||
.put("cluster.routing.operation.hash.type", "djb")
|
.put("cluster.routing.operation.hash.type", "djb")
|
||||||
.put("cluster.routing.operation.use_type", "false")
|
.put("cluster.routing.operation.use_type", "false")
|
||||||
.build();
|
.build();
|
||||||
|
|
Loading…
Reference in New Issue