zentol commented on a change in pull request #11667: [FLINK-15936] Harden
TaskExecutorTest#testSlotAcceptance
URL: https://github.com/apache/flink/pull/11667#discussion_r406090698
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java
##########
@@ -1005,6 +1012,23 @@ private void requestSlots(TaskExecutorGateway
tmGateway, Iterable<? extends Allo
}
}
+ private Either<Acknowledge, Throwable> submitNoOpInvokableTask(
+ AllocationID allocationId,
+ TestingJobMasterGateway jobMasterGateway,
+ TaskExecutorGateway tmGateway) throws IOException {
+ final TaskDeploymentDescriptor tdd =
TaskDeploymentDescriptorBuilder
+ .newBuilder(jobId, NoOpInvokable.class)
+ .setAllocationId(allocationId)
+ .build();
+
+ try {
+ // submit the task without having acknowledge the
offered slots
+ return Either.Left(tmGateway.submitTask(tdd,
jobMasterGateway.getFencingToken(), timeout).join());
+ } catch (CompletionException e) {
+ return Either.Right(e.getCause());
Review comment:
Why not just let the cause bubble up, possibly enriching it?
You could then use `assertThrows` for checking the exception.
----------------------------------------------------------------
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