Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manager/orchestrator/replicated/task_reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,11 @@ func TestServiceRemoveDeadTasks(t *testing.T) {

// Set both task states to RUNNING.
updatedTask1 := observedTask1.Copy()
updatedTask1.DesiredState = api.TaskStateRunning
updatedTask1.Status.State = api.TaskStateRunning
updatedTask1.ServiceAnnotations = api.Annotations{Name: "original"}
updatedTask2 := observedTask2.Copy()
updatedTask2.DesiredState = api.TaskStateRunning
updatedTask2.Status.State = api.TaskStateRunning
updatedTask2.ServiceAnnotations = api.Annotations{Name: "original"}
err = s.Update(func(tx store.Tx) error {
Expand All @@ -512,9 +514,11 @@ func TestServiceRemoveDeadTasks(t *testing.T) {

// Set both tasks to COMPLETED.
updatedTask3 := observedTask1.Copy()
updatedTask3.DesiredState = api.TaskStateCompleted
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of setting this to api.TaskStateShutdown because this is what happens in actual behavior (even though the test would work fine with this).

updatedTask3.Status.State = api.TaskStateCompleted
updatedTask3.ServiceAnnotations = api.Annotations{Name: "original"}
updatedTask4 := observedTask2.Copy()
updatedTask4.DesiredState = api.TaskStateCompleted
updatedTask4.Status.State = api.TaskStateCompleted
updatedTask4.ServiceAnnotations = api.Annotations{Name: "original"}
err = s.Update(func(tx store.Tx) error {
Expand Down