Skip to content

Commit 4440a82

Browse files
committed
Create a thread dump if ES fails to start in packaging tests (#48932)
Relates to #15385. Hoping to get some insight on CI failures.
1 parent 9a5aaaa commit 4440a82

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,16 @@ public void test50StartAndStop() throws Exception {
137137
// cleanup from previous test
138138
rm(installation.config("elasticsearch.keystore"));
139139

140-
Archives.runElasticsearch(installation, sh);
140+
try {
141+
Archives.runElasticsearch(installation, sh);
142+
} catch (Exception e ){
143+
if (Files.exists(installation.home.resolve("elasticsearch.pid"))) {
144+
String pid = FileUtils.slurp(installation.home.resolve("elasticsearch.pid")).trim();
145+
logger.info("Dumping jstack of elasticsearch processb ({}) that failed to start", pid);
146+
sh.runIgnoreExitCode("jstack " + pid);
147+
}
148+
throw e;
149+
}
141150

142151
final String gcLogName = Platforms.LINUX && distribution().hasJdk == false
143152
? "gc.log.0.current"

0 commit comments

Comments
 (0)