Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ tests:
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=snapshot/20_operator_privileges_disabled/Operator only settings can be set and restored by non-operator user when operator privileges is disabled}
issue: https://github.com/elastic/elasticsearch/issues/120973
- class: org.elasticsearch.packaging.test.DockerTests
issue: https://github.com/elastic/elasticsearch/issues/120978
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountIT
method: testAuthenticateShouldNotFallThroughInCaseOfFailure
issue: https://github.com/elastic/elasticsearch/issues/120902
Expand Down Expand Up @@ -416,4 +414,4 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/126085
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/search/retriever/line_906}
issue: https://github.com/elastic/elasticsearch/issues/131041
issue: https://github.com/elastic/elasticsearch/issues/131041
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ public abstract class PackagingTestCase extends Assert {
@Override
protected void failed(Throwable e, Description description) {
failed = true;
if (installation != null && installation.distribution.isDocker()) {
logger.warn("Test {} failed. Printing logs for failed test...", description.getMethodName());
dumpDebug();
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,19 @@ private static HttpResponse execute(Request request, String username, String pas
executor.auth(username, password);
executor.authPreemptive(new HttpHost("localhost", 9200));
}
return executor.execute(request).returnResponse();
try {
return executor.execute(request).returnResponse();
} catch (Exception e) {
logger.warn(
"Failed to execute request [{}] with username/password [{}/{}] and caCert [{}]",
request.toString(),
username,
password,
caCert,
e
);
throw e;
}
}

// polls every two seconds for Elasticsearch to be running on 9200
Expand Down Expand Up @@ -238,14 +250,13 @@ public static void waitForElasticsearch(
long timeElapsed = 0;
boolean started = false;
Throwable thrownException = null;
if (caCert == null) {
caCert = getCaCert(installation);
}

while (started == false && timeElapsed < waitTime) {
if (System.currentTimeMillis() - lastRequest > requestInterval) {
if (caCert == null) {
caCert = getCaCert(installation);
}
try {

final HttpResponse response = execute(
Request.Get((caCert != null ? "https" : "http") + "://localhost:9200/_cluster/health")
.connectTimeout((int) timeoutLength)
Expand Down Expand Up @@ -276,7 +287,7 @@ public static void waitForElasticsearch(
}
started = true;

} catch (IOException e) {
} catch (Exception e) {
if (thrownException == null) {
thrownException = e;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class Docker {
public static final Shell sh = new Shell();
public static final DockerShell dockerShell = new DockerShell();
public static final int STARTUP_SLEEP_INTERVAL_MILLISECONDS = 1000;
public static final int STARTUP_ATTEMPTS_MAX = 30;
public static final int STARTUP_ATTEMPTS_MAX = 45;

/**
* The length of the command exceeds what we can use for COLUMNS so we use
Expand Down