Github user GJL commented on the issue:

    https://github.com/apache/flink/pull/4933
  
    While you are at it: 
    
    `ExecutionGraphTestUtils#switchToRunning` 
    ```
    public static void switchToRunning(ExecutionGraph eg) {
                // check that all execution are in state DEPLOYING
                for (ExecutionVertex ev : eg.getAllExecutionVertices()) {
                        final Execution exec = ev.getCurrentExecutionAttempt();
                        assert(exec.getState() == ExecutionState.DEPLOYING);
                }
    
                // switch executions to RUNNING
                for (ExecutionVertex ev : eg.getAllExecutionVertices()) {
                        final Execution exec = ev.getCurrentExecutionAttempt();
                        exec.switchToRunning();
                }
        }
    ```
    
    could be improved to
    
    ```
    public static void switchToRunning(ExecutionGraph eg) {
                // check that all execution are in state DEPLOYING
                for (ExecutionVertex ev : eg.getAllExecutionVertices()) {
                        final Execution exec = ev.getCurrentExecutionAttempt();
                        final ExecutionState executionState = exec.getState();
                        assert executionState == ExecutionState.DEPLOYING 
                                : "Expected executionState to be DEPLOYING, 
was: " + executionState;
                }
    
                // switch executions to RUNNING
                for (ExecutionVertex ev : eg.getAllExecutionVertices()) {
                        final Execution exec = ev.getCurrentExecutionAttempt();
                        exec.switchToRunning();
                }
        }
    ```
    
    so that the failure reason is more obvious.


---

Reply via email to