spuru9 commented on code in PR #30183:
URL: https://github.com/apache/flink/pull/30183#discussion_r4723581984
##########
flink-runtime/src/test/java/org/apache/flink/runtime/source/coordinator/ExecutorNotifierTest.java:
##########
@@ -79,24 +79,31 @@ public void testBasic() throws InterruptedException {
latch.countDown();
});
latch.await();
- assertEquals(1234, result.get());
+ assertThat(result).hasValue(1234);
}
@Test
- public void testExceptionInCallable() {
+ void testExceptionInCallable() throws InterruptedException {
Exception exception = new Exception("Expected exception.");
+ CountDownLatch latch = new CountDownLatch(1);
+ AtomicReference<Object> result = new AtomicReference<>();
+ AtomicReference<Throwable> error = new AtomicReference<>();
notifier.notifyReadyAsync(
() -> {
throw exception;
},
(v, e) -> {
- assertEquals(exception, e);
- assertNull(v);
+ result.set(v);
+ error.set(e);
+ latch.countDown();
});
+ latch.await();
Review Comment:
Kept the plain await() on purpose. Flink's test guidelines prefer relying on
the global CI timeout over local ones, since it takes thread dumps, and the
other tests in this class wait the same way.
--
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]