zentol commented on a change in pull request #15251:
URL: https://github.com/apache/flink/pull/15251#discussion_r597633457



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveSchedulerTest.java
##########
@@ -722,25 +727,50 @@ public void testRestoringModifiedJobFromSavepointFails() 
throws Exception {
         final DefaultDeclarativeSlotPool declarativeSlotPool =
                 createDeclarativeSlotPool(jobGraphWithNewOperator.getJobID());
 
-        final AdaptiveScheduler adaptiveScheduler =
-                new AdaptiveSchedulerBuilder(jobGraphWithNewOperator, 
mainThreadExecutor)
-                        .setDeclarativeSlotPool(declarativeSlotPool)
-                        .build();
-
-        adaptiveScheduler.startScheduling();
-
-        offerSlots(
-                declarativeSlotPool,
-                createSlotOffersForResourceRequirements(
-                        ResourceCounter.withResource(ResourceProfile.UNKNOWN, 
1)));
-
-        final ArchivedExecutionGraph archivedExecutionGraph =
-                adaptiveScheduler.requestJob().getArchivedExecutionGraph();
-
-        assertThat(archivedExecutionGraph.getState(), is(JobStatus.FAILED));
-        assertThat(
-                archivedExecutionGraph.getFailureInfo().getException(),
-                FlinkMatchers.containsMessage("Failed to rollback to 
checkpoint/savepoint"));
+        final GloballyTerminalJobStatusListener jobStatusListener =
+                new GloballyTerminalJobStatusListener();
+
+        final ScheduledExecutorService singleThreadExecutor =
+                Executors.newSingleThreadScheduledExecutor();
+
+        try {
+            final ComponentMainThreadExecutor singleMainThreadExecutor =
+                    
ComponentMainThreadExecutorServiceAdapter.forSingleThreadExecutor(

Review comment:
       I agree that we should reduce usages of the manual executor, but that 
wasn't the direction I intended to go.
   I was more thinking along the lines of 
`ComponentMainThreadExecutorServiceAdapter.forMainThread()`




-- 
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]


Reply via email to