[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:
parent
56a2fb04ee
commit
fdfdf594f9
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue