-
Notifications
You must be signed in to change notification settings - Fork 61
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
Consume numNodes sent during integTestRemote #1085
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,6 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |
lateinit var testClusters : Map<String, TestCluster> | ||
var isSecurityPropertyEnabled = false | ||
var forceInitSecurityConfiguration = false | ||
var isMultiNodeClusterConfiguration = true | ||
|
||
internal fun createTestCluster(configuration: ClusterConfiguration) : TestCluster { | ||
return createTestCluster(configuration.clusterName, configuration.preserveSnapshots, configuration.preserveIndices, | ||
|
@@ -131,7 +130,6 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |
val httpHostsProp = systemProperties.get("tests.cluster.${cluster}.http_hosts") as String? | ||
val transportHostsProp = systemProperties.get("tests.cluster.${cluster}.transport_hosts") as String? | ||
val securityEnabled = systemProperties.get("tests.cluster.${cluster}.security_enabled") as String? | ||
val totalNodes = systemProperties.get("tests.cluster.${cluster}.total_nodes") as String? | ||
|
||
requireNotNull(httpHostsProp) { "Missing http hosts property for cluster: $cluster."} | ||
requireNotNull(transportHostsProp) { "Missing transport hosts property for cluster: $cluster."} | ||
|
@@ -143,9 +141,6 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |
isSecurityPropertyEnabled = true | ||
} | ||
|
||
if(totalNodes != null && totalNodes < "2") { | ||
isMultiNodeClusterConfiguration = false | ||
} | ||
|
||
forceInitSecurityConfiguration = isSecurityPropertyEnabled && initSecurityConfiguration | ||
|
||
|
@@ -664,6 +659,19 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { | |
return integTestRemote.equals("true") | ||
} | ||
|
||
protected fun isMultiNodeClusterConfiguration(leaderCluster: String, followerCluster: String): Boolean{ | ||
val systemProperties = BootstrapInfo.getSystemProperties() | ||
val totalLeaderNodes = systemProperties.get("tests.cluster.${leaderCluster}.total_nodes") as String | ||
val totalFollowerNodes = systemProperties.get("tests.cluster.${followerCluster}.total_nodes") as String | ||
|
||
assertNotNull(totalLeaderNodes) | ||
assertNotNull(totalFollowerNodes) | ||
if(totalLeaderNodes < "2" || totalFollowerNodes < "2" ) { | ||
return false | ||
} | ||
return true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If integ tests are run locally, we are always setting the property and same with integTest Remote There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then let's remove the null check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and add an assertion instead |
||
} | ||
|
||
protected fun docCount(cluster: RestHighLevelClient, indexName: String) : Int { | ||
val persistentConnectionRequest = Request("GET", "/$indexName/_search?pretty&q=*") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For integTestRemote set total_nodes