Copilot commented on code in PR #30183:
URL: https://github.com/apache/flink/pull/30183#discussion_r4723536570
##########
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:
If the exception-path handler never runs—the regression this test is
intended to detect—this unbounded wait hangs the test instead of failing it,
and prevents executor cleanup from running. Please use a timed await and assert
that it completed so a missing notification produces a bounded, diagnostic
failure.
--
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]