Skip to content

Commit e2d36ba

Browse files
committed
[hotfix] Replace AskTimeException usages in tests
1 parent 5d3ca59 commit e2d36ba

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/DeclarativeSlotManagerTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656

5757
import org.apache.flink.shaded.guava18.com.google.common.collect.Iterators;
5858

59-
import akka.pattern.AskTimeoutException;
6059
import org.junit.Test;
6160

6261
import java.util.ArrayList;
@@ -602,7 +601,7 @@ public void testSlotAllocationTimeout() throws Exception {
602601
final BlockingQueue<Supplier<CompletableFuture<Acknowledge>>> responseQueue =
603602
new ArrayBlockingQueue<>(2);
604603
responseQueue.add(
605-
() -> FutureUtils.completedExceptionally(new AskTimeoutException("timeout")));
604+
() -> FutureUtils.completedExceptionally(new TimeoutException("timeout")));
606605
responseQueue.add(
607606
() -> {
608607
secondSlotRequestFuture.complete(null);

flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/DefaultSlotStatusSyncerTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
import org.apache.flink.util.TestLogger;
3737
import org.apache.flink.util.concurrent.FutureUtils;
3838

39-
import akka.pattern.AskTimeoutException;
4039
import org.junit.Test;
4140

4241
import java.util.Arrays;
4342
import java.util.concurrent.CompletableFuture;
43+
import java.util.concurrent.TimeoutException;
4444

4545
import static org.hamcrest.Matchers.contains;
4646
import static org.hamcrest.Matchers.empty;
@@ -126,7 +126,7 @@ public void testAllocateSlotFailsWithException() {
126126
.setRequestSlotFunction(
127127
ignored ->
128128
FutureUtils.completedExceptionally(
129-
new AskTimeoutException("timeout")))
129+
new TimeoutException("timeout")))
130130
.createTestingTaskExecutorGateway();
131131
final TaskExecutorConnection taskExecutorConnection =
132132
new TaskExecutorConnection(ResourceID.generate(), taskExecutorGateway);
@@ -151,7 +151,7 @@ public void testAllocateSlotFailsWithException() {
151151
try {
152152
allocatedFuture.get();
153153
} catch (Exception e) {
154-
assertThat(e.getCause(), instanceOf(AskTimeoutException.class));
154+
assertThat(e.getCause(), instanceOf(TimeoutException.class));
155155
}
156156
assertThat(resourceTracker.getAcquiredResources(jobId), is(empty()));
157157
assertThat(

0 commit comments

Comments
 (0)