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_r339058764
 
 

 ##########
 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) {
+                       final int exceptionSize = exceptionSize2QuerySize.f0;
+                       final int querySize = exceptionSize2QuerySize.f1;
+                       final AccessExecutionGraph archivedExecutionGraph = 
createAccessExecutionGraph(exceptionSize);
+                       int finalShowSize = exceptionSize >= querySize ? 
querySize : exceptionSize;
+                       final HandlerRequest<EmptyRequestBody, 
JobExceptionsMessageParameters> handlerRequest = 
createRequest(archivedExecutionGraph.getJobID(), querySize);
+                       final JobExceptionsInfo jobExceptionsInfo = 
jobExceptionsHandler.handleRequest(handlerRequest, archivedExecutionGraph);
+                       
assertEquals(jobExceptionsInfo.getAllExceptions().size(), finalShowSize);
+               }
+       }
 
+       private AccessExecutionGraph createAccessExecutionGraph(int taskSize) {
 
 Review comment:
   rename `taskSize` to `numTasks`
   
   Can we make this method static, along with 
`createArchivedExecutionJobVertex` and `createRequest`?

----------------------------------------------------------------
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

Reply via email to