Skip to content

Pass override settings when creating test cluster #71203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
}

@Override
protected Settings nodeSettings(final int nodeOrdinal) {
protected Settings nodeSettings(final int nodeOrdinal, final Settings otherSettings) {
final Path databasePath = createTempDir();
try {
Files.createDirectories(databasePath);
Expand All @@ -50,7 +50,7 @@ protected Settings nodeSettings(final int nodeOrdinal) {
return Settings.builder()
.put("ingest.geoip.database_path", databasePath)
.put(GeoIpDownloaderTaskExecutor.ENABLED_SETTING.getKey(), false)
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal));
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
if (ENDPOINT != null) {
settings.put(GeoIpDownloader.ENDPOINT_SETTING.getKey(), ENDPOINT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal));
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder settings = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
if (ENDPOINT != null) {
settings.put(GeoIpDownloader.ENDPOINT_SETTING.getKey(), ENDPOINT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
public class GeoIpProcessorNonIngestNodeIT extends AbstractGeoIpIT {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal)).put(nonIngestNode()).build();
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)).put(nonIngestNode()).build();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
//TODO: please convert to unit tests!
public class StoredExpressionIT extends ESIntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
builder.put("script.allowed_contexts", "update");
return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
* Lower the queue sizes to be small enough that bulk will time out and have to be retried.
*/
@Override
protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal)).put(nodeSettings()).build();
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings)).put(nodeSettings()).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ protected boolean addMockTransportService() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
// randomize netty settings
if (randomBoolean()) {
builder.put(Netty4Transport.WORKER_COUNT.getKey(), random().nextInt(3) + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ protected boolean addMockHttpTransport() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(HierarchyCircuitBreakerService.IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), LIMIT)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public class Netty4TransportMultiPortIntegrationIT extends ESNetty4IntegTestCase
private static String randomPortRange;

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
if (randomPort == -1) {
randomPort = randomIntBetween(49152, 65525);
randomPortRange = String.format(Locale.ROOT, "%s-%s", randomPort, randomPort + 10);
}
Settings.Builder builder = Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put("network.host", "127.0.0.1")
.put("transport.profiles.client1.port", randomPortRange)
.put("transport.profiles.client1.publish_host", "127.0.0.7")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0)
public class Netty4TransportPublishAddressIT extends ESNetty4IntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(NetworkModule.TRANSPORT_TYPE_KEY, Netty4Plugin.NETTY_TRANSPORT_NAME)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void clearAzureNodes() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder builder = Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "azure");

// We add a fake subscription_id to start mock compute service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ public static void setupKeyStore() throws IOException {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Path resolve = logDir.resolve(Integer.toString(nodeOrdinal));
try {
Files.createDirectory(resolve);
} catch (IOException e) {
throw new RuntimeException(e);
}
return Settings.builder().put(super.nodeSettings(nodeOrdinal))
return Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), AzureDiscoveryPlugin.AZURE)
.put(Environment.PATH_LOGS_SETTING.getKey(), resolve)
.put(TransportSettings.PORT.getKey(), 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
public abstract class AbstractAwsTestCase extends ESIntegTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder settings = Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir());

// if explicit, just load it and don't load from env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "gce")
.put("cloud.gce.project_id", "test")
.put("cloud.gce.zone", "test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected HttpHandler createErroneousHttpHandler(final HttpHandler delegate) {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
final String key = Base64.getEncoder().encodeToString(randomAlphaOfLength(14).getBytes(StandardCharsets.UTF_8));
final MockSecureSettings secureSettings = new MockSecureSettings();
String accountName = DEFAULT_ACCOUNT_NAME;
Expand All @@ -92,7 +92,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
// see com.azure.storage.blob.BlobUrlParts.parseIpUrl
final String endpoint = "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=" + httpServerUrl() + "/" + accountName;
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(AzureStorageSettings.ENDPOINT_SUFFIX_SETTING.getConcreteSettingForNamespace("test").getKey(), endpoint)
.setSecureSettings(secureSettings)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ protected HttpHandler createErroneousHttpHandler(final HttpHandler delegate) {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
final Settings.Builder settings = Settings.builder();
settings.put(super.nodeSettings(nodeOrdinal));
settings.put(super.nodeSettings(nodeOrdinal, otherSettings));
settings.put(ENDPOINT_SETTING.getConcreteSettingForNamespace("test").getKey(), httpServerUrl());
settings.put(TOKEN_URI_SETTING.getConcreteSettingForNamespace("test").getKey(), httpServerUrl() + "/token");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected HttpHandler createErroneousHttpHandler(final HttpHandler delegate) {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
final MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString(S3ClientSettings.ACCESS_KEY_SETTING.getConcreteSettingForNamespace("test").getKey(), "test_access_key");
secureSettings.setString(S3ClientSettings.SECRET_KEY_SETTING.getConcreteSettingForNamespace("test").getKey(), "test_secret_key");
Expand All @@ -124,7 +124,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
.put(S3ClientSettings.DISABLE_CHUNKED_ENCODING.getConcreteSettingForNamespace("test").getKey(), true)
// Disable request throttling because some random values in tests might generate too many failures for the S3 client
.put(S3ClientSettings.USE_THROTTLE_RETRIES_SETTING.getConcreteSettingForNamespace("test").getKey(), false)
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.setSecureSettings(secureSettings);

if (signerOverride != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ protected boolean addMockTransportService() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal, otherSettings));
// randomize nio settings
if (randomBoolean()) {
builder.put(NioTransportPlugin.NIO_WORKER_COUNT.getKey(), random().nextInt(3) + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ protected boolean addMockInternalEngine() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
// disable internal cluster info service to avoid internal cluster stats calls
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), false)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
public class CorsRegexIT extends HttpSmokeTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(SETTING_CORS_ALLOW_ORIGIN.getKey(), "/https?:\\/\\/localhost(:[0-9]+)?/")
.put(SETTING_CORS_ALLOW_CREDENTIALS.getKey(), true)
.put(SETTING_CORS_ALLOW_METHODS.getKey(), "get, options, post")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class DetailedErrorsDisabledIT extends HttpSmokeTestCase {

// Build our cluster settings
@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(HttpTransportSettings.SETTING_HTTP_DETAILED_ERRORS_ENABLED.getKey(), false)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ protected boolean addMockHttpTransport() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(NetworkModule.TRANSPORT_TYPE_KEY, nodeTransportTypeKey)
.put(NetworkModule.HTTP_TYPE_KEY, nodeHttpTypeKey).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public class IndexingPressureRestIT extends HttpSmokeTestCase {
private static final Settings unboundedWriteQueue = Settings.builder().put("thread_pool.write.queue_size", -1).build();

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(IndexingPressure.MAX_INDEXING_BYTES.getKey(), "1KB")
.put(unboundedWriteQueue)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
public class IndicesStatsRestCancellationIT extends BlockedSearcherRestCancellationTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
// disable internal cluster info service to avoid internal indices stats calls
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), false)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ protected int minimumNumberOfReplicas() {
}

@Override
protected Settings nodeSettings(int ordinal) {
protected Settings nodeSettings(int ordinal, Settings otherSettings) {
// must set this independently of the plugin so it overrides MockTransportService
return Settings.builder().put(super.nodeSettings(ordinal))
return Settings.builder().put(super.nodeSettings(ordinal, otherSettings))
// InternalClusterInfoService sends IndicesStatsRequest periodically which messes with this test
// this setting disables it...
.put("cluster.routing.allocation.disk.threshold_enabled", false).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
public class RejectionActionIT extends ESIntegTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put("thread_pool.search.size", 1)
.put("thread_pool.search.queue_size", 1)
.put("thread_pool.write.size", 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(MockTaskManager.USE_MOCK_TASK_MANAGER_SETTING.getKey(), true)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public class BulkProcessorRetryIT extends ESIntegTestCase {
private static final String INDEX_NAME = "test";

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
//Have very low pool and queue sizes to overwhelm internal pools easily
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
// don't mess with this one! It's quite sensitive to a low queue size
// (see also ThreadedActionListener which is happily spawning threads even when we already got rejected)
//.put("thread_pool.listener.queue_size", 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
public class BulkRejectionIT extends ESIntegTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put("thread_pool.write.size", 1)
.put("thread_pool.write.queue_size", 1)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
public class PointInTimeIT extends ESIntegTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put(SearchService.KEEPALIVE_INTERVAL_SETTING.getKey(), TimeValue.timeValueMillis(randomIntBetween(100, 500)))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public void process(FetchSubPhase.HitContext hitContext) {
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(super.nodeSettings(nodeOrdinal, otherSettings))
.put("indices.breaker.request.type", "memory")
.build();
}
Expand Down
Loading