Skip to content

Commit 871b38a

Browse files
Check cluster health in integration test wait condition
With this commit we do not check only if an endpoint is up but we also check that the cluster status is green. Previously, builds sporadically failed to pass this condition.
1 parent 03087cf commit 871b38a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterConfiguration.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ class ClusterConfiguration {
5757
@Input
5858
Closure waitCondition = { NodeInfo node, AntBuilder ant ->
5959
File tmpFile = new File(node.cwd, 'wait.success')
60-
ant.echo(message: "[${LocalDateTime.now()}] Waiting for elasticsearch node ${node.httpUri()}", level: "info")
61-
ant.get(src: "http://${node.httpUri()}",
60+
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=${numNodes}",
6261
dest: tmpFile.toString(),
6362
ignoreerrors: true, // do not fail on error, so logging buffers can be flushed by the wait task
6463
retries: 10)
65-
ant.echo(message: "[${LocalDateTime.now()}] Finished waiting for elasticsearch node ${node.httpUri()}. Reachable? ${tmpFile.exists()}", level: "info")
6664
return tmpFile.exists()
6765
}
6866

0 commit comments

Comments
 (0)