RyanSkraba commented on a change in pull request #18848:
URL: https://github.com/apache/flink/pull/18848#discussion_r828286800
##########
File path:
flink-rpc/flink-rpc-akka/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceTest.java
##########
@@ -140,28 +137,30 @@ public void testExecuteCallable() throws Exception {
int actual = result.get(30L, TimeUnit.SECONDS);
- assertEquals(expected, actual);
- assertTrue(latch.isTriggered());
+ assertThat(actual).isEqualTo(expected);
+ assertThat(latch.isTriggered()).isTrue();
}
@Test
- public void testGetAddress() {
- assertEquals(AkkaUtils.getAddress(actorSystem).host().get(),
akkaRpcService.getAddress());
+ void testGetAddress() {
+ assertThat(akkaRpcService.getAddress())
+ .isEqualTo(AkkaUtils.getAddress(actorSystem).host().get());
}
@Test
- public void testGetPort() {
- assertEquals(AkkaUtils.getAddress(actorSystem).port().get(),
akkaRpcService.getPort());
+ void testGetPort() {
+ assertThat(akkaRpcService.getPort())
+ .isEqualTo(AkkaUtils.getAddress(actorSystem).port().get());
}
/** Tests that we can wait for the termination of the rpc service. */
- @Test(timeout = 60000)
Review comment:
Probably the right place to have these timeouts are in the
`terminationFuture.get()` below, even better if we can predict whether we can
expect them to succeed for fail.
##########
File path:
flink-rpc/flink-rpc-akka/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceTest.java
##########
@@ -205,17 +204,17 @@ public void
testScheduledExecutorServicePeriodicSchedule() throws Exception {
scheduledExecutor.scheduleAtFixedRate(
countDownLatch::countDown, delay, delay,
TimeUnit.MILLISECONDS);
- assertTrue(!future.isDone());
+ assertThat(!future.isDone()).isTrue();
countDownLatch.await();
// the future should not complete since we have a periodic task
- assertTrue(!future.isDone());
+ assertThat(!future.isDone()).isTrue();
long finalTime = System.nanoTime() - currentTime;
// the processing should have taken at least delay times the number of
count downs.
- assertTrue(finalTime >= tries * delay);
+ assertThat(finalTime >= tries * delay).isTrue();
Review comment:
```suggestion
assertThat(finalTime).isGreaterThanOrEqualTo(tries * delay);
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]