|
9 | 9 | import java.util.Map;
|
10 | 10 | import java.util.Properties;
|
11 | 11 | import java.util.logging.FileHandler;
|
| 12 | +import java.util.logging.Level; |
12 | 13 | import java.util.logging.Logger;
|
13 | 14 | import java.util.logging.SimpleFormatter;
|
14 | 15 | import javax.jms.Connection;
|
@@ -585,23 +586,35 @@ private void callWebAppAndVerifyScaling(Domain domain, int replicas) throws Exce
|
585 | 586 | }
|
586 | 587 |
|
587 | 588 | public static void tearDown() throws Exception {
|
| 589 | + logger.log( |
| 590 | + Level.INFO, |
| 591 | + "TEARDOWN: Starting Test Run TearDown (cleanup and state-dump)." |
| 592 | + + " Note that if the test failed previous to tearDown, " |
| 593 | + + " the error that caused the test failure may be reported " |
| 594 | + + "after the tearDown completes. Note that tearDown itself may report errors," |
| 595 | + + " but this won't affect the outcome of the test results."); |
588 | 596 | StringBuffer cmd =
|
589 | 597 | new StringBuffer("export RESULT_ROOT=$RESULT_ROOT && export PV_ROOT=$PV_ROOT && ");
|
590 | 598 | cmd.append(BaseTest.getProjectRoot())
|
591 | 599 | .append("/integration-tests/src/test/resources/statedump.sh");
|
592 | 600 | logger.info("Running " + cmd);
|
593 | 601 |
|
| 602 | + // renew lease before callin statedump.sh |
| 603 | + TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId()); |
| 604 | + |
594 | 605 | ExecResult result = ExecCommand.exec(cmd.toString());
|
595 | 606 | if (result.exitValue() == 0) {
|
596 |
| - logger.info("Executed statedump.sh " + result.stdout()); |
| 607 | + // logger.info("Executed statedump.sh " + result.stdout()); |
597 | 608 | } else {
|
598 | 609 | logger.info("Execution of statedump.sh failed, " + result.stderr() + "\n" + result.stdout());
|
599 | 610 | }
|
600 | 611 |
|
601 |
| - // if (JENKINS) { |
602 |
| - result = cleanup(); |
603 |
| - logger.info("cleanup result =" + result.stdout() + "\n " + result.stderr()); |
604 |
| - // } |
| 612 | + if (JENKINS) { |
| 613 | + result = cleanup(); |
| 614 | + if (result.exitValue() != 0) { |
| 615 | + logger.info("cleanup result =" + result.stdout() + "\n " + result.stderr()); |
| 616 | + } |
| 617 | + } |
605 | 618 |
|
606 | 619 | if (getLeaseId() != "") {
|
607 | 620 | logger.info("Release the k8s cluster lease");
|
|
0 commit comments