Class RetryOnFailureStrategy

java.lang.Object
org.apache.flink.testutils.junit.extensions.retry.strategy.AbstractRetryStrategy
org.apache.flink.testutils.junit.extensions.retry.strategy.RetryOnFailureStrategy
All Implemented Interfaces:
RetryStrategy

public class RetryOnFailureStrategy extends AbstractRetryStrategy
Retry strategy that retry fixed times.
  • Constructor Details

    • RetryOnFailureStrategy

      public RetryOnFailureStrategy(int retryTimes)
  • Method Details

    • handleException

      public void handleException(String testName, int attemptIndex, Throwable throwable) throws Throwable
      Description copied from interface: RetryStrategy
      Handle an exception that occurred during the annotated test attempt.

      This method can swallow the exception to pass the test.

      Parameters:
      testName - the test name
      attemptIndex - test attempt index that starts from 1
      throwable - the throwable that the test case throws
      Throws:
      org.opentest4j.TestAbortedException - When handling a test attempt failure, throwing this exception indicates another attempt should be made.
      Throwable - Propagating the original exception, or throwing any other exception indicates that the test has definitively failed and no further attempts should be made.