Skip to content

Commit 726c67d

Browse files
committed
Increase timeouts for packaging tests (elastic#48528)
This is in preparation to move to nested virtualization which is much slower than the bare metal setup we use right now, but parallelizes better resulting in a net win.t
1 parent b8d6018 commit 726c67d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

qa/os/bats/default/bootstrap_password.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ NODE_SETTINGS
8080

8181
password=$(cat /tmp/bootstrap.password)
8282
clusterHealth=$(sudo curl -u "elastic:$password" -H "Content-Type: application/json" \
83-
-XGET "http://127.0.0.1:9200/_cluster/health?wait_for_status=green&timeout=30s")
83+
-XGET "http://127.0.0.1:9200/_cluster/health?wait_for_status=green&timeout=180s")
8484
echo "$clusterHealth" | grep '"status":"green"' || {
8585
echo "Expected cluster health to be green but got:"
8686
echo "$clusterHealth"

qa/os/bats/utils/utils.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ run_elasticsearch_service() {
349349
if [ "$expectedStatus" = 0 ]; then
350350
background="-d"
351351
else
352-
timeoutCommand="timeout 60s "
352+
timeoutCommand="timeout 180s "
353353
fi
354354
# su and the Elasticsearch init script work together to break bats.
355355
# sudo isolates bats enough from the init script so everything continues
@@ -476,10 +476,10 @@ wait_for_elasticsearch_status() {
476476

477477
if [ -z "index" ]; then
478478
echo "Tring to connect to elasticsearch and wait for expected status $desiredStatus..."
479-
curl -sS "http://localhost:9200/_cluster/health?wait_for_status=$desiredStatus&timeout=60s&pretty"
479+
curl -sS "http://localhost:9200/_cluster/health?wait_for_status=$desiredStatus&timeout=180s&pretty"
480480
else
481481
echo "Trying to connect to elasticsearch and wait for expected status $desiredStatus for index $index"
482-
curl -sS "http://localhost:9200/_cluster/health/$index?wait_for_status=$desiredStatus&timeout=60s&pretty"
482+
curl -sS "http://localhost:9200/_cluster/health/$index?wait_for_status=$desiredStatus&timeout=180s&pretty"
483483
fi
484484
if [ $? -eq 0 ]; then
485485
echo "Connected"

qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ public class ServerUtils {
3737

3838
protected static final Logger logger = LogManager.getLogger(ServerUtils.class);
3939

40-
private static final long waitTime = TimeUnit.SECONDS.toMillis(60);
41-
private static final long timeoutLength = TimeUnit.SECONDS.toMillis(10);
40+
// generous timeout as nested virtualization can be quite slow ...
41+
private static final long waitTime = TimeUnit.MINUTES.toMillis(
42+
System.getProperty("tests.inVM") == null ? 3 : 1
43+
);
44+
private static final long timeoutLength = TimeUnit.SECONDS.toMillis(
45+
System.getProperty("tests.inVM") == null ? 30 : 10
46+
);
4247

4348
public static void waitForElasticsearch(Installation installation) throws IOException {
4449
waitForElasticsearch("green", null, installation);

0 commit comments

Comments
 (0)