fijolekProjects commented on code in PR #1019:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1019#discussion_r2296777806
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkServiceTest.java:
##########
@@ -1315,6 +1318,51 @@ public void
testBlockingDeletionDeleteCallErrorHandling() {
assertTrue(remaining.toMillis() < 1000);
}
+ @Test
+ public void listingJobExceptionsIsCompatibleWihFlinkV1_17Test() throws
Exception {
+ var flinkV117JsonResponse =
+ "{\n"
+ + " \"root-exception\":
\"org.apache.flink.util.FlinkExpectedException: The TaskExecutor is shutting
down.\\n\\tat
org.apache.flink.runtime.taskexecutor.TaskExecutor.onStop(TaskExecutor.java:476)\\n\\tat
org.apache.flink.runtime.rpc.RpcEndpoint.internalCallOnStop(RpcEndpoint.java:239)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor$StartedState.lambda$terminate$0(AkkaRpcActor.java:578)\\n\\tat
org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:83)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor$StartedState.terminate(AkkaRpcActor.java:577)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleControlMessage(AkkaRpcActor.java:196)\\n\\tat
akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24)\\n\\tat
akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20)\\n\\tat
scala.PartialFunction.applyOrElse(PartialFunction.scala:127)\\n\\tat
scala.PartialFunction.applyOrElse$(Part
ialFunction.scala:126)\\n\\tat
akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20)\\n\\tat
scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:175)\\n\\tat
scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:176)\\n\\tat
akka.actor.Actor.aroundReceive(Actor.scala:537)\\n\\tat
akka.actor.Actor.aroundReceive$(Actor.scala:535)\\n\\tat
akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220)\\n\\tat
akka.actor.ActorCell.receiveMessage(ActorCell.scala:579)\\n\\tat
akka.actor.ActorCell.invoke(ActorCell.scala:547)\\n\\tat
akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)\\n\\tat
akka.dispatch.Mailbox.run(Mailbox.scala:231)\\n\\tat
akka.dispatch.Mailbox.exec(Mailbox.scala:243)\\n\\tat
java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)\\n\\tat
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown
Source)\\n\\tat java.base/java.util.concurrent.ForkJoinPool.scan(Unknown
Source)\\n\\tat java.base/java.util.c
oncurrent.ForkJoinPool.runWorker(Unknown Source)\\n\\tat
java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)\\n\",\n"
+ + " \"timestamp\": 1755995361447,\n"
+ + " \"all-exceptions\": [],\n"
+ + " \"truncated\": false,\n"
+ + " \"exceptionHistory\": {\n"
+ + " \"entries\": [\n"
+ + " {\n"
+ + " \"exceptionName\":
\"org.apache.flink.util.FlinkExpectedException\",\n"
+ + " \"stacktrace\":
\"org.apache.flink.util.FlinkExpectedException: The TaskExecutor is shutting
down.\\n\\tat
org.apache.flink.runtime.taskexecutor.TaskExecutor.onStop(TaskExecutor.java:476)\\n\\tat
org.apache.flink.runtime.rpc.RpcEndpoint.internalCallOnStop(RpcEndpoint.java:239)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor$StartedState.lambda$terminate$0(AkkaRpcActor.java:578)\\n\\tat
org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:83)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor$StartedState.terminate(AkkaRpcActor.java:577)\\n\\tat
org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleControlMessage(AkkaRpcActor.java:196)\\n\\tat
akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24)\\n\\tat
akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20)\\n\\tat
scala.PartialFunction.applyOrElse(PartialFunction.scala:127)\\n\\tat
scala.PartialFunction.applyOrElse$(Pa
rtialFunction.scala:126)\\n\\tat
akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20)\\n\\tat
scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:175)\\n\\tat
scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:176)\\n\\tat
akka.actor.Actor.aroundReceive(Actor.scala:537)\\n\\tat
akka.actor.Actor.aroundReceive$(Actor.scala:535)\\n\\tat
akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220)\\n\\tat
akka.actor.ActorCell.receiveMessage(ActorCell.scala:579)\\n\\tat
akka.actor.ActorCell.invoke(ActorCell.scala:547)\\n\\tat
akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)\\n\\tat
akka.dispatch.Mailbox.run(Mailbox.scala:231)\\n\\tat
akka.dispatch.Mailbox.exec(Mailbox.scala:243)\\n\\tat
java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)\\n\\tat
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown
Source)\\n\\tat java.base/java.util.concurrent.ForkJoinPool.scan(Unknown
Source)\\n\\tat java.base/java.util
.concurrent.ForkJoinPool.runWorker(Unknown Source)\\n\\tat
java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)\\n\",\n"
+ + " \"timestamp\": 1755995361447,\n"
+ + " \"taskName\": \"Source: Custom Source (2/2)
- execution #0\",\n"
+ + " \"location\": \"10.244.0.93:37079\",\n"
+ + " \"taskManagerId\":
\"basic-example-taskmanager-1-1\",\n"
+ + " \"concurrentExceptions\": []\n"
+ + " }\n"
+ + " ],\n"
+ + " \"truncated\": false\n"
+ + " }\n"
+ + "}";
+ var flinkService =
+ getTestingService(
+ (messageHeaders, messageParameters, requestBody) ->
+ CompletableFuture.completedFuture(
+
parseExceptionsJsonResponse(flinkV117JsonResponse)));
+
+ var jobExceptions =
+ flinkService.getJobExceptions(
+ TestUtils.buildApplicationCluster(), new JobID(), new
Configuration());
+ assertNotNull(jobExceptions);
+ assertEquals(1,
jobExceptions.getExceptionHistory().getEntries().size());
+ }
+
+ @SneakyThrows
+ private static JobExceptionsInfoWithHistory parseExceptionsJsonResponse(
Review Comment:
this parsing is based on `org.apache.flink.runtime.rest.RestClient`
https://github.com/apache/flink/blob/d81751aea0b1de18fec392edd960cc4483a2527e/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestClient.java#L671
--
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]