Johnlon commented on a change in pull request #9456: FLINK-13588
flink-streaming-java don't throw away exception info in logging
URL: https://github.com/apache/flink/pull/9456#discussion_r314818982
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTest.java
##########
@@ -180,6 +180,25 @@
@Rule
public final Timeout timeoutPerTest = Timeout.seconds(30);
+ /**
+ * This test checks the async exceptions handling wraps the message and
cause as an AsynchronousException
+ * and propagates this to the environment.
+ */
+ @Test
+ public void exceptionReporting() {
+ Environment e = mock(Environment.class);
+ RuntimeException expectedException = new
RuntimeException("RUNTIME EXCEPTION");
+
+ SourceStreamTask sut = new SourceStreamTask(e);
+ sut.handleAsyncException("EXPECTED_ERROR", expectedException);
+
+ ArgumentCaptor<AsynchronousException> c =
ArgumentCaptor.forClass(AsynchronousException.class);
+ verify(e).failExternally(c.capture());
+ assertEquals(c.getValue().getMessage(), "EXPECTED_ERROR");
+ assertEquals(c.getValue().getCause(), expectedException);
+ assertEquals(expectedException,
"AsynchronousException{EXPECTED_ERROR, caused by RUNTIME EXCEPTION}");
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services