[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.
This commit is contained in:
javanna 2015-03-17 21:36:13 -07:00 committed by Luca Cavanna
parent 56a2fb04ee
commit fdfdf594f9
1 changed files with 2 additions and 0 deletions

View File

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