1
0
Эх сурвалжийг харах

[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 жил өмнө
parent
commit
fdfdf594f9

+ 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;
                         }
                     }
                 }