GJL commented on a change in pull request #9904: [FLINK-14232][runtime] Support
global failure handling in NG scheduling
URL: https://github.com/apache/flink/pull/9904#discussion_r338021780
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/failover/flip1/ExecutionFailureHandlerTest.java
##########
@@ -167,23 +164,49 @@ public void testUnrecoverableErrorCheck() {
new Exception(new SuppressRestartsException(new
Exception()))));
}
+ @Test
+ public void testGlobalFailureHandling() {
+ final FailureHandlingResult result =
executionFailureHandler.getGlobalFailureHandlingResult(
+ new Exception("test failure"));
+
+ assertTrue(result.canRestart());
+ assertEquals(restartDelayMs, result.getRestartDelayMS());
+ assertEquals(
+
StreamSupport.stream(failoverTopology.getFailoverVertices().spliterator(),
false)
+ .map(FailoverVertex::getExecutionVertexID)
+ .collect(Collectors.toSet()),
+ result.getVerticesToRestart());
+ try {
+ result.getError();
+ fail("Cannot get error when the restarting is
accepted");
+ } catch (IllegalStateException ex) {
+ // expected
+ }
+ }
+
//
------------------------------------------------------------------------
// utilities
//
------------------------------------------------------------------------
/**
- * A FailoverStrategy implementation for tests. It always suggest
restarting the given task set on construction.
+ * A FailoverStrategy implementation for tests. It always suggests
restarting the given tasks to restart.
*/
private class TestFailoverStrategy implements FailoverStrategy {
Review comment:
I would make this class static.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services