You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by uc...@apache.org on 2016/02/25 00:06:00 UTC
flink git commit: [FLINK-3500] [test] Fix possible instability in
ExecutionGraphRestartTest
Repository: flink
Updated Branches:
refs/heads/master b94d99d8a -> e811e6eb4
[FLINK-3500] [test] Fix possible instability in ExecutionGraphRestartTest
After restart of the execution graph, the test driver waits for the
graph to assign the new executions in a loop. If switchToRunning()
is called multiple times in this loop, the job is canceled. This
could happen, if one execution had its resource assigned and called
switchToRunning(), but the other didn't. In this case, the complete
loop was retried and switchToRunning() was called again.
This closes #1708.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/e811e6eb
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/e811e6eb
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/e811e6eb
Branch: refs/heads/master
Commit: e811e6eb419daa5062d3402d9660bb52db0f37c6
Parents: b94d99d
Author: Ufuk Celebi <uc...@apache.org>
Authored: Wed Feb 24 20:39:37 2016 +0100
Committer: Ufuk Celebi <uc...@apache.org>
Committed: Thu Feb 25 00:05:41 2016 +0100
----------------------------------------------------------------------
.../executiongraph/ExecutionGraphRestartTest.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/e811e6eb/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java
index 7cef66a..925b574 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java
@@ -440,8 +440,8 @@ public class ExecutionGraphRestartTest extends TestLogger {
Execution failedExecution = executionVertices.next().getCurrentExecutionAttempt();
finishedExecution.markFinished();
- failedExecution.fail(new Exception("Test Exception"));
+ failedExecution.fail(new Exception("Test Exception"));
failedExecution.cancelingComplete();
FiniteDuration timeout = new FiniteDuration(2, TimeUnit.MINUTES);
@@ -456,8 +456,9 @@ public class ExecutionGraphRestartTest extends TestLogger {
// Wait for deploying after async restart
deadline = timeout.fromNow();
- boolean success = false;
+ // Wait for all resources to be assigned after async restart
+ boolean success = false;
while (deadline.hasTimeLeft() && !success) {
success = true;
@@ -466,12 +467,16 @@ public class ExecutionGraphRestartTest extends TestLogger {
success = false;
Thread.sleep(100);
break;
- } else {
- vertex.getCurrentExecutionAttempt().switchToRunning();
}
}
}
+ // At this point all resources have been assigned
+ for (ExecutionVertex vertex : eg.getAllExecutionVertices()) {
+ assertNotNull("No assigned resource (test instability).", vertex.getCurrentAssignedResource());
+ vertex.getCurrentExecutionAttempt().switchToRunning();
+ }
+
// fail old finished execution, this should not affect the execution
finishedExecution.fail(new Exception("This should have no effect"));