소스 검색

[TEST] RepeatOnExceptionRule to rethrow unexpected exception

In case an exception was caught by the repeat rule, the retry mechanism would kick in only if the exception was the expected one. If not an NPE got thrown, while we should rather just bubble it up to the caller. This makes `NettyTransportMultiPortTests` run from a plane. An assumption would kick in to make sure that the test gets ignored but the `AssumptionViolationException` was caught and not properly re-thrown.
javanna 10 년 전
부모
커밋
fdfdf594f9
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/test/java/org/elasticsearch/test/junit/rule/RepeatOnExceptionRule.java

+ 2 - 0
src/test/java/org/elasticsearch/test/junit/rule/RepeatOnExceptionRule.java

@@ -66,6 +66,8 @@ public class RepeatOnExceptionRule implements TestRule {
                         if (t.getClass().equals(expectedException)) {
                             caughtThrowable = t;
                             logger.info("Exception [{}] occurred, rerunning the test after [{}] failures", t, t.getClass().getSimpleName(), i+1);
+                        } else {
+                            throw t;
                         }
                     }
                 }