XComp commented on a change in pull request #16156: URL: https://github.com/apache/flink/pull/16156#discussion_r655299795
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/testutils/TestingUtils.java ########## @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.testutils; + +import org.apache.flink.api.common.time.Time; +import org.apache.flink.runtime.concurrent.ScheduledExecutor; +import org.apache.flink.runtime.concurrent.ScheduledExecutorServiceAdapter; + +import java.time.Duration; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +/** Convenience functions to test actor based components. */ +public class TestingUtils { + + public static final Duration TESTING_DURATION = Duration.ofMinutes(2L); + public static final Duration TESTING_TIMEOUT = Duration.ofMinutes(1L); Review comment: This is never used and could be removed entirely. It was also never used in the Scala version. ########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/LeaderElectionTest.java ########## @@ -210,8 +210,7 @@ public LeaderElectionService createLeaderElectionService() throws Exception { @Override public void setup() { - embeddedLeaderService = - new EmbeddedLeaderService(TestingUtils.defaultExecutionContext()); + embeddedLeaderService = new EmbeddedLeaderService(TestingUtils.defaultExecutor()); Review comment: Just to be sure because I had to dig a bit into it to understand what Scala's `ExecutionContext` does: We are able to do that since `EmbeddedLeaderService` requires `Executor` interface and does not use the `reportFailure` or `prepare` method that are part of Scala's `ExecutionContext`. -- 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