Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
cosmetic changes: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Lich committed Sep 9, 2018
1 parent 03066aa commit 5293884
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void retry(String workflowId) {
}
List<Task> rescheduledTasks = new ArrayList<>();
failedTasks.forEach(failedTask -> {
rescheduledTasks.add(rescheduleTask(failedTask));
rescheduledTasks.add(taskToBeRescheduled(failedTask));
});

// Reschedule the cancelled task but if the join is cancelled set that to in progress
Expand All @@ -284,7 +284,7 @@ public void retry(String workflowId) {
cancelledTask.setStatus(IN_PROGRESS);
executionDAO.updateTask(cancelledTask);
} else {
rescheduledTasks.add(rescheduleTask(cancelledTask));
rescheduledTasks.add(taskToBeRescheduled(cancelledTask));
}
});

Expand Down Expand Up @@ -316,7 +316,7 @@ List<Task> getFailedTasksToRetry(Workflow workflow) {
* @param task failed or cancelled task
* @return new instance of a task with "SCHEDULED" status
*/
private Task rescheduleTask(Task task) {
private Task taskToBeRescheduled(Task task) {
Task taskToBeRetried = task.copy();
taskToBeRetried.setTaskId(IDGenerator.generate());
taskToBeRetried.setRetriedTaskId(task.getTaskId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,23 +324,20 @@ public void testGetFailedTasksToRetry() {
assertEquals(1, tasks.size());
assertEquals(task_1_1.getTaskId(), tasks.get(0).getTaskId());

//2 tasks witih the same definition but different reference numbers
//2 tasks with the same definition but different reference numbers
workflow.setTasks(Arrays.asList(task_1_3_1,task_1_3_2));
tasks = workflowExecutor.getFailedTasksToRetry(workflow);
assertEquals(1, tasks.size());
assertEquals(task_1_3_2.getTaskId(), tasks.get(0).getTaskId());

//3 tasks witih definitions and referece numbers

//3 tasks with definitions and reference numbers
workflow.setTasks(Arrays.asList(task_1_1,task_1_2, task_1_3_1, task_1_3_2, task_2_1, task_2_2, task_3_1));
tasks = workflowExecutor.getFailedTasksToRetry(workflow);
assertEquals(4, tasks.size());
assertTrue(tasks.contains(task_1_1));
assertTrue(tasks.contains(task_1_2));
assertTrue(tasks.contains(task_2_2));
assertTrue(tasks.contains(task_1_3_2));


}


Expand Down

0 comments on commit 5293884

Please sign in to comment.