mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
Factor out waiting for easier redefinition
This commit is contained in:
parent
6f13171d50
commit
57b1b72af6
@ -110,6 +110,20 @@
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!-- waits for elasticsearch to start -->
|
||||
<macrodef name="waitfor-elasticsearch">
|
||||
<attribute name="port"/>
|
||||
<attribute name="timeoutproperty"/>
|
||||
<sequential>
|
||||
<echo>Waiting for elasticsearch to become available on port @{port}...</echo>
|
||||
<waitfor maxwait="30" maxwaitunit="second"
|
||||
checkevery="500" checkeveryunit="millisecond"
|
||||
timeoutproperty="@{timeoutproperty}">
|
||||
<http url="http://127.0.0.1:@{port}"/>
|
||||
</waitfor>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!-- start elasticsearch and wait until its ready -->
|
||||
<macrodef name="startup-elasticsearch">
|
||||
<attribute name="home" default="${integ.scratch}/elasticsearch-${elasticsearch.version}"/>
|
||||
@ -148,12 +162,10 @@
|
||||
</nested>
|
||||
</run-script>
|
||||
|
||||
<!-- wait for startup -->
|
||||
<local name="failed.to.start"/>
|
||||
<waitfor maxwait="30" maxwaitunit="second"
|
||||
checkevery="500" checkeveryunit="millisecond"
|
||||
timeoutproperty="failed.to.start">
|
||||
<http url="http://127.0.0.1:@{es.http.port}"/>
|
||||
</waitfor>
|
||||
<waitfor-elasticsearch port="@{es.http.port}"
|
||||
timeoutproperty="failed.to.start"/>
|
||||
|
||||
<!-- best effort, print console log. useful if it fails especially -->
|
||||
<local name="log.contents"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user