use of org.apache.flink.runtime.execution.SuppressRestartsException in project flink by apache.
the class ExecutionGraphSignalsTest method testSuppressRestartFailureWhileRestarting.
/**
* Tests that a {@link SuppressRestartsException} in state RESTARTING stops the restarting
* immediately and sets the execution graph's state to FAILED.
*/
@Test
public void testSuppressRestartFailureWhileRestarting() throws IllegalAccessException, NoSuchFieldException {
Field restartStrategyField = eg.getClass().getDeclaredField("restartStrategy");
restartStrategyField.setAccessible(true);
restartStrategyField.set(eg, new InfiniteDelayRestartStrategy());
f.set(eg, JobStatus.RESTARTING);
// suppress a possible restart
eg.fail(new SuppressRestartsException(new Exception("Test")));
assertEquals(JobStatus.FAILED, eg.getState());
}
Aggregations