You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/10/10 16:39:03 UTC
[GitHub] [flink] GJL commented on a change in pull request #9872:
[FLINK-14291][runtime, tests] Add test coverage to DefaultScheduler
GJL commented on a change in pull request #9872: [FLINK-14291][runtime,tests] Add test coverage to DefaultScheduler
URL: https://github.com/apache/flink/pull/9872#discussion_r333622933
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/DefaultSchedulerTest.java
##########
@@ -252,18 +249,27 @@ public void failJobIfNotEnoughResources() throws Exception {
findThrowableWithMessage(
failureCause,
"Could not allocate the required slot within slot request timeout.").isPresent());
+ assertThat(jobStatus, is(equalTo(JobStatus.FAILED)));
}
- private void drainAllAvailableSlots() {
- final int numberOfAvailableSlots = slotProvider.getNumberOfAvailableSlots();
- for (int i = 0; i < numberOfAvailableSlots; i++) {
- slotProvider.allocateSlot(
- new SlotRequestId(),
- new ScheduledUnit(new JobVertexID(), null, null),
- SlotProfile.noRequirements(),
- true,
- Time.milliseconds(TIMEOUT_MS));
- }
+ @Test
+ public void skipDeploymentIfVertexVersionOutdated() {
+ final JobGraph jobGraph = singleNonParallelJobVertexJobGraph();
+
+ final DefaultScheduler scheduler = createSchedulerAndStartScheduling(jobGraph);
+
+ final List<ExecutionVertexID> initiallyScheduledVertices = testExecutionVertexOperations.getDeployedVertices();
+
+ final ArchivedExecutionVertex onlyExecutionVertex = Iterables.getOnlyElement(scheduler.requestJob().getAllExecutionVertices());
+ final ExecutionAttemptID attemptId = onlyExecutionVertex.getCurrentExecutionAttempt().getAttemptId();
+ scheduler.updateTaskExecutionState(new TaskExecutionState(jobGraph.getJobID(), attemptId, ExecutionState.FAILED));
+
+ testExecutionSlotAllocator.disableAutoCompletePendingRequests();
+ taskRestartExecutor.triggerScheduledTasks();
+ executionVertexVersioner.recordModification(new ExecutionVertexID(getOnlyJobVertex(jobGraph).getID(), 0));
+ testExecutionSlotAllocator.completePendingRequests();
+
+ assertThat(initiallyScheduledVertices, is(equalTo(testExecutionVertexOperations.getDeployedVertices())));
Review comment:
Fixed, I think.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services