Skip to content

Commit

Permalink
Debug failed environments
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo authored and losipiuk committed Aug 25, 2020
1 parent 30910bf commit 268fcd1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.base.Throwables.getStackTraceAsString;
import static io.prestosql.tests.product.launcher.cli.Commands.runCommand;
import static io.prestosql.tests.product.launcher.docker.ContainerUtil.exposePort;
import static io.prestosql.tests.product.launcher.env.common.Standard.CONTAINER_TEMPTO_PROFILE_CONFIG;
Expand Down Expand Up @@ -146,9 +147,10 @@ public void run()
{
RetryPolicy<Object> retryPolicy = new RetryPolicy<>()
.withMaxRetries(startupRetries)
.onFailedAttempt(event -> log.warn("Could not start environment '%s': %s", environment, event.getLastFailure()))
.onFailedAttempt(event -> log.warn("Could not start environment '%s': %s", environment, getStackTraceAsString(event.getLastFailure())))
.onRetry(event -> log.info("Trying to start environment '%s', %d failed attempt(s)", environment, event.getAttemptCount() + 1))
.onSuccess(event -> log.info("Environment '%s' started in %s, %d attempt(s)", environment, event.getElapsedTime(), event.getAttemptCount()));
.onSuccess(event -> log.info("Environment '%s' started in %s, %d attempt(s)", environment, event.getElapsedTime(), event.getAttemptCount()))
.onFailure(event -> log.info("Environment '%s' failed to start in attempt(s): %d: %s", environment, event.getAttemptCount(), event.getFailure()));

try (UncheckedCloseable ignore = this::cleanUp) {
Environment environment = Failsafe.with(retryPolicy)
Expand Down

0 comments on commit 268fcd1

Please sign in to comment.