zentol commented on a change in pull request #18761:
URL: https://github.com/apache/flink/pull/18761#discussion_r805966277
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/CreatingExecutionGraphTest.java
##########
@@ -149,9 +159,27 @@ public void
testSuccessfulSlotAssignmentTransitionsToExecuting() throws Exceptio
actualExecutionGraph ->
assertThat(actualExecutionGraph,
sameInstance(executionGraph)));
- executionGraphWithvertexParallelismFuture.complete(
+ final AtomicReference<Throwable> handledFailureRef = new
AtomicReference<>();
+ context.setCreateExecutingStateFunction(
+ () ->
+ new AdaptiveSchedulerTest.DummyState() {
+
+ @Override
+ public void handleGlobalFailure(Throwable
cause) {
+ handledFailureRef.set(cause);
+ }
+ });
+
+ executionGraphWithVertexParallelismFuture.complete(
CreatingExecutionGraph.ExecutionGraphWithVertexParallelism.create(
executionGraph, new TestingVertexParallelism()));
+
+ final Throwable t = new RuntimeException("Test.");
+ errorHandlerRef.get().accept(t);
+ assertEquals(
+ "OperatorCoordinator should use failure handler of the
Executing state.",
+ t,
+ handledFailureRef.get());
Review comment:
This overall seems unsafe. There's no requirement that the error handler
for different states are actually different instances.
What you rather want to test is that a failure in the coordinator calls into
the scheduler.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]