Skip to content

Commit ee5e683

Browse files
authored
Skip packaging test log file stashing once tests have failed (#58520)
When a packaging test completes, we move the elasticsearch logfile to another location so that if the next test fails, we have just the contents of the test that ran. However, once the test fails, we continue trying to move this file in the subsequent calls to teardown when the rest of the tests are skipped. This commit skips the teardown step once we have marked the suite as failed.
1 parent 55e2ec6 commit ee5e683

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void setup() throws Exception {
178178
public void teardown() throws Exception {
179179
// move log file so we can avoid false positives when grepping for
180180
// messages in logs during test
181-
if (installation != null) {
181+
if (installation != null && failed == false) {
182182
if (Files.exists(installation.logs)) {
183183
Path logFile = installation.logs.resolve("elasticsearch.log");
184184
String prefix = this.getClass().getSimpleName() + "." + testNameRule.getMethodName();

0 commit comments

Comments
 (0)