-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Unmute docker tests, add more logging and increase startup timeout #131203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
836b465
2d63199
0c386d2
765dae7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,7 +151,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 | ||
|
@@ -239,14 +251,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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case of slow auto-configuration, the HTTP CA certificate may not have been configured when |
||
} | ||
try { | ||
|
||
final HttpResponse response = execute( | ||
Request.Get((caCert != null ? "https" : "http") + "://localhost:9200/_cluster/health") | ||
.connectTimeout((int) timeoutLength) | ||
|
@@ -277,7 +288,7 @@ public static void waitForElasticsearch( | |
} | ||
started = true; | ||
|
||
} catch (IOException e) { | ||
} catch (Exception e) { | ||
if (thrownException == null) { | ||
thrownException = e; | ||
} else { | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the uncaught docker failures did not include any cluster logs, which makes it super hard to troubleshoot.