Create a thread dump if ES fails to start in packaging tests (#48932)

Relates to #15385.
Hoping to get some insight on CI failures.
This commit is contained in:
Alpar Torok 2019-11-12 10:08:01 +02:00
parent ea9f094e75
commit 5c6f8bab8d
1 changed files with 10 additions and 1 deletions

View File

@ -137,7 +137,16 @@ public class ArchiveTests extends PackagingTestCase {
// cleanup from previous test
rm(installation.config("elasticsearch.keystore"));
Archives.runElasticsearch(installation, sh);
try {
Archives.runElasticsearch(installation, sh);
} catch (Exception e ){
if (Files.exists(installation.home.resolve("elasticsearch.pid"))) {
String pid = FileUtils.slurp(installation.home.resolve("elasticsearch.pid")).trim();
logger.info("Dumping jstack of elasticsearch processb ({}) that failed to start", pid);
sh.runIgnoreExitCode("jstack " + pid);
}
throw e;
}
final String gcLogName = Platforms.LINUX && distribution().hasJdk == false
? "gc.log.0.current"