GJL commented on a change in pull request #7661: [FLINK-11515][client] Port
ClientTest
URL: https://github.com/apache/flink/pull/7661#discussion_r254674001
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
##########
@@ -752,6 +752,33 @@ public void
testRetriableSendOperationIfConnectionErrorOrServiceUnavailable() th
}
}
+ @Test
+ public void testJobSubmissionFailureThrowsProgramInvocationException()
throws Exception {
+ try (final TestRestServerEndpoint restServerEndpoint =
createRestServerEndpoint(new SubmissionFailingHandler())) {
+ RestClusterClient<?> restClusterClient =
createRestClusterClient(restServerEndpoint.getServerAddress().getPort());
+
+ try {
+ restClusterClient.submitJob(jobGraph,
ClassLoader.getSystemClassLoader());
+ } catch (final ProgramInvocationException expected) {
+ // expected
+ } finally {
+ restClusterClient.shutdown();
+ }
+ }
+ }
+
+ private final class SubmissionFailingHandler extends
TestHandler<JobSubmitRequestBody, JobSubmitResponseBody,
EmptyMessageParameters> {
+
+ private SubmissionFailingHandler() {
+ super(JobSubmitHeaders.getInstance());
+ }
+
+ @Override
+ protected CompletableFuture<JobSubmitResponseBody>
handleRequest(@Nonnull HandlerRequest<JobSubmitRequestBody,
EmptyMessageParameters> request, @Nonnull DispatcherGateway gateway) throws
RestHandlerException {
Review comment:
Line maybe too long.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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