Skip to content

Commit

Permalink
Merge pull request #384 from mesos/bug/369-SanityCheckState
Browse files Browse the repository at this point in the history
Bug: KILLED wasn't considered an error state.
  • Loading branch information
Phil Winder committed Oct 26, 2015
2 parents 2fa55c9 + d6c8838 commit b1300c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public boolean taskInError() {

public static boolean errorState(TaskState state) {
return state.equals(TaskState.TASK_ERROR) || state.equals(TaskState.TASK_FAILED)
|| state.equals(TaskState.TASK_LOST) || state.equals(TaskState.TASK_FINISHED);
|| state.equals(TaskState.TASK_LOST) || state.equals(TaskState.TASK_FINISHED)
|| state.equals(TaskState.TASK_KILLED);
}

public void destroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,10 @@ public void shouldErrorWhenTaskFinishedToUpdateState() throws IOException {
when(state.get(anyString())).thenReturn(ProtoTestUtil.getDefaultTaskStatus(Protos.TaskState.TASK_FINISHED));
Assert.assertTrue(status.taskInError());
}

@Test
public void shouldErrorWhenTaskKilled() throws IOException {
when(state.get(anyString())).thenReturn(ProtoTestUtil.getDefaultTaskStatus(Protos.TaskState.TASK_KILLED));
Assert.assertTrue(status.taskInError());
}
}

0 comments on commit b1300c8

Please sign in to comment.