mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Merge pull request #12155 from jaymode/external_test_cluster_settings
allow settings to be passed to client for external test cluster
This commit is contained in:
commit
15d62713b1
@ -1650,7 +1650,11 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
|
|||||||
throw new IllegalArgumentException("port is not valid, expected number but was [" + split[1] + "]");
|
throw new IllegalArgumentException("port is not valid, expected number but was [" + split[1] + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ExternalTestCluster(createTempDir(), transportAddresses);
|
return new ExternalTestCluster(createTempDir(), externalClusterClientSettings(), transportAddresses);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Settings externalClusterClientSettings() {
|
||||||
|
return Settings.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TestCluster buildTestCluster(Scope scope, long seed) throws IOException {
|
protected TestCluster buildTestCluster(Scope scope, long seed) throws IOException {
|
||||||
|
@ -65,9 +65,10 @@ public final class ExternalTestCluster extends TestCluster {
|
|||||||
private final int numDataNodes;
|
private final int numDataNodes;
|
||||||
private final int numMasterAndDataNodes;
|
private final int numMasterAndDataNodes;
|
||||||
|
|
||||||
public ExternalTestCluster(Path tempDir, TransportAddress... transportAddresses) {
|
public ExternalTestCluster(Path tempDir, Settings additionalSettings, TransportAddress... transportAddresses) {
|
||||||
super(0);
|
super(0);
|
||||||
Settings clientSettings = Settings.settingsBuilder()
|
Settings clientSettings = Settings.settingsBuilder()
|
||||||
|
.put(additionalSettings)
|
||||||
.put("name", InternalTestCluster.TRANSPORT_CLIENT_PREFIX + EXTERNAL_CLUSTER_PREFIX + counter.getAndIncrement())
|
.put("name", InternalTestCluster.TRANSPORT_CLIENT_PREFIX + EXTERNAL_CLUSTER_PREFIX + counter.getAndIncrement())
|
||||||
.put(InternalSettingsPreparer.IGNORE_SYSTEM_PROPERTIES_SETTING, true) // prevents any settings to be replaced by system properties.
|
.put(InternalSettingsPreparer.IGNORE_SYSTEM_PROPERTIES_SETTING, true) // prevents any settings to be replaced by system properties.
|
||||||
.put("client.transport.ignore_cluster_name", true)
|
.put("client.transport.ignore_cluster_name", true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user