azagrebin commented on a change in pull request #8226: [FLINK-12181][Tests] Port ExecutionGraphRestartTest to new codebase URL: https://github.com/apache/flink/pull/8226#discussion_r279342636
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionGraphRestartTest.java ########## @@ -99,6 +106,23 @@ private TestingComponentMainThreadExecutorServiceAdapter mainThreadExecutor = TestingComponentMainThreadExecutorServiceAdapter.forMainThread(); + private JobID jobId; + + private TaskManagerLocation taskManagerLocation; + + private SimpleAckingTaskManagerGateway taskManagerGateway; + + private TestingResourceManagerGateway resourceManagerGateway; + + @Before + public void setUp() throws Exception { + this.jobId = new JobID(); + + taskManagerLocation = new LocalTaskManagerLocation(); + taskManagerGateway = new SimpleAckingTaskManagerGateway(); Review comment: Why do we need these variables created globally? They could be created and used only in private graph/scheduler creation methods after some code deduplication. Also `taskManagerGateway` is created again locally in some tests: `testLocalFailAndRestart`, `testRestartWithEagerSchedulingAndSlotSharing`, `testRestartWithSlotSharingAndNotEnoughResources` which might not be needed. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services