zentol commented on a change in pull request #9859: [FLINK-11405][rest]rest api
can more exceptions by query parameter
URL: https://github.com/apache/flink/pull/9859#discussion_r339062380
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobExceptionsHandlerTest.java
##########
@@ -66,23 +69,30 @@ public void testGetJobExceptionsInfo() throws
HandlerRequestException {
JobExceptionsHeaders.getInstance(),
new ExecutionGraphCache(TestingUtils.TIMEOUT(),
TestingUtils.TIMEOUT()),
TestingUtils.defaultExecutor());
+ List<Tuple2<Integer, Integer>> exceptionSize2QuerySizeList =
new ArrayList<>();
+ exceptionSize2QuerySizeList.add(new Tuple2<>(50, 20));
+ exceptionSize2QuerySizeList.add(new Tuple2<>(30, 30));
+ exceptionSize2QuerySizeList.add(new Tuple2<>(10, 20));
+ for (Tuple2<Integer, Integer> exceptionSize2QuerySize:
exceptionSize2QuerySizeList) {
Review comment:
I think we can simplify this as we don't need multiple execution graphs, one
is sufficient:
```
...
final int numExceptions = 30;
final AccessExecutionGraph archivedExecutionGraph =
createAccessExecutionGraph(numExceptions);
checkExceptionLimit(archivedExecutionGraph, 50, numExceptions);
checkExceptionLimit(archivedExecutionGraph, numExceptions,
numExceptions);
checkExceptionLimit(archivedExecutionGraph, 10, 10);
}
private static void checkExceptionLimit(AccessExecutionGraph graph, int
maxNumExceptions, int numExpectedException) {
final HandlerRequest<EmptyRequestBody, JobExceptionsMessageParameters>
handlerRequest = createRequest(graph.getJobID(), maxNumExceptions);
final JobExceptionsInfo jobExceptionsInfo =
jobExceptionsHandler.handleRequest(handlerRequest, graph);
assertEquals(jobExceptionsInfo.getAllExceptions().size(),
numExpectedException);
}
```
----------------------------------------------------------------
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