File tree Expand file tree Collapse file tree
main/java/com/hubspot/singularity/mesos
test/java/com/hubspot/singularity/scheduler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -787,7 +787,7 @@ private CompletableFuture<StatusUpdateResult> handleStatusUpdateAsync(
787787 );
788788 }
789789 if (result == StatusUpdateResult .KILL_TASK ) {
790- LOG .info (
790+ LOG .warn (
791791 "Killing a task {} which Singularity has no remaining active state for. It will be given 1 minute to shut down gracefully" ,
792792 status .getTaskId ().getValue ()
793793 );
Original file line number Diff line number Diff line change @@ -2622,14 +2622,23 @@ public void testTaskOddities() {
26222622
26232623 Assertions .assertTrue (taskManager .isActiveTask (taskOne .getTaskId ()));
26242624
2625- statusUpdate (taskOne , TaskState .TASK_RUNNING );
2626- List <SingularityTaskHistoryUpdate > updates = taskManager .getTaskHistoryUpdates (
2627- taskOne .getTaskId ()
2628- );
2629- Assertions .assertEquals (2 , updates .size ());
2630- Assertions .assertTrue (
2631- updates .stream ().anyMatch (t -> t .getTaskState () == ExtendedTaskState .TASK_CLEANING )
2625+ // assert that we sent back a status that was not DONE for the status update (e.g. KILL_TASK)
2626+ Assertions .assertFalse (
2627+ sms
2628+ .statusUpdate (
2629+ TaskStatus
2630+ .newBuilder ()
2631+ .setTaskId (MesosProtosUtils .toTaskId (taskOne .getMesosTask ().getTaskId ()))
2632+ .setAgentId (MesosProtosUtils .toAgentId (taskOne .getAgentId ()))
2633+ .setState (TaskState .TASK_RUNNING )
2634+ .build ()
2635+ )
2636+ .join ()
26322637 );
2638+
2639+ // Task should get killed because we cannot recover any state
2640+ statusUpdate (taskOne , TaskState .TASK_KILLED );
2641+ Assertions .assertFalse (taskManager .isActiveTask (taskOne .getTaskId ()));
26332642 }
26342643
26352644 @ Test
You can’t perform that action at this time.
0 commit comments