mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 21:18:31 +00:00
8c01d6ea69
The wait condition used for integ tests by default calls the cluster health api with wait_for_nodes nd wait_for_status. However, xpack overrides the wait condition to add auth, but most of these conditions still looked at the root ES url, which means the tests are susceptible to race conditions with the check and node startup. This change modifies the url for the authenticated wait condtion to check the health api, with the appropriate wait_for_nodes and wait_for_status. Original commit: elastic/x-pack-elasticsearch@0b23ef528f
51 lines
1.8 KiB
Groovy
51 lines
1.8 KiB
Groovy
subprojects {
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
dependencies {
|
|
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'runtime')
|
|
}
|
|
|
|
// bring in monitoring rest test suite
|
|
task copyMonitoringRestTests(type: Copy) {
|
|
into project.sourceSets.test.output.resourcesDir
|
|
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources.srcDirs
|
|
include 'rest-api-spec/test/monitoring/**'
|
|
}
|
|
|
|
integTest {
|
|
dependsOn copyMonitoringRestTests
|
|
}
|
|
|
|
integTestCluster {
|
|
systemProperty 'es.logger.level', 'TRACE'
|
|
plugin ':x-pack-elasticsearch:plugin'
|
|
setting 'xpack.monitoring.collection.interval', '3s'
|
|
extraConfigFile 'x-pack/roles.yml', '../roles.yml'
|
|
setupCommand 'setupTestAdminUser',
|
|
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'changeme', '-r', 'superuser'
|
|
setupCommand 'setupMonitoredSystemUser',
|
|
'bin/x-pack/users', 'useradd', 'monitoring_system', '-p', 'changeme', '-r', 'monitoring_system,monitoring_without_bulk'
|
|
setupCommand 'setupPowerlessUser',
|
|
'bin/x-pack/users', 'useradd', 'not_monitoring_system', '-p', 'changeme', '-r', 'monitoring_without_bulk'
|
|
|
|
waitCondition = { node, ant ->
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
dest: tmpFile.toString(),
|
|
username: 'test_admin',
|
|
password: 'changeme',
|
|
ignoreerrors: true,
|
|
retries: 10)
|
|
return tmpFile.exists()
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Allow {@code integTest} to be invoked on this project to run both Monitoring+Security smoke tests.
|
|
*/
|
|
task integTest {
|
|
dependsOn subprojects.integTest
|
|
}
|