Skip packaging test log file stashing once tests have failed ()

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.
This commit is contained in:
Ryan Ernst 2020-06-29 13:33:39 -07:00 committed by Ryan Ernst
parent 67a5a2bb60
commit 35a703db16
No known key found for this signature in database
GPG Key ID: 5F7EA39E15F54DCE

@ -178,7 +178,7 @@ public abstract class PackagingTestCase extends Assert {
public void teardown() throws Exception {
// move log file so we can avoid false positives when grepping for
// messages in logs during test
if (installation != null) {
if (installation != null && failed == false) {
if (Files.exists(installation.logs)) {
Path logFile = installation.logs.resolve("elasticsearch.log");
String prefix = this.getClass().getSimpleName() + "." + testNameRule.getMethodName();