File tree 1 file changed +3
-1
lines changed
flink-runtime/src/test/java/org/apache/flink/runtime/rpc
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -376,13 +376,14 @@ public void testCallAsyncTimeout()
376
376
throws InterruptedException , ExecutionException , TimeoutException {
377
377
final RpcEndpoint endpoint = new BaseEndpoint (rpcService );
378
378
final Time timeout = Time .milliseconds (100 );
379
+ CountDownLatch latch = new CountDownLatch (1 );
379
380
try {
380
381
endpoint .start ();
381
382
final CompletableFuture <Throwable > throwableFuture =
382
383
endpoint .callAsync (
383
384
() -> {
384
385
endpoint .validateRunsInMainThread ();
385
- TimeUnit . MILLISECONDS . sleep ( timeout . toMilliseconds () * 2 );
386
+ latch . await ( );
386
387
return 12345 ;
387
388
},
388
389
timeout )
@@ -392,6 +393,7 @@ public void testCallAsyncTimeout()
392
393
assertNotNull (throwable );
393
394
assertThat (throwable , instanceOf (TimeoutException .class ));
394
395
} finally {
396
+ latch .countDown ();
395
397
RpcUtils .terminateRpcEndpoint (endpoint , TIMEOUT );
396
398
}
397
399
}
You can’t perform that action at this time.
0 commit comments