From cd9da16f145029a7e5781f143986e82b4638b8db Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 3 Jul 2017 13:39:39 -0700 Subject: [PATCH] System jobs without evals are running too --- nomad/state/state_store.go | 8 +------- nomad/state/state_store_test.go | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index 97bc0c5b5ee..91b4598447f 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -2130,14 +2130,8 @@ func (s *StateStore) getJobStatus(txn *memdb.Txn, job *structs.Job, evalDelete b return structs.JobStatusDead, nil } - if hasEval { - // At least one completed eval - return structs.JobStatusRunning, nil - } - // Pending until at least one eval has completed - return structs.JobStatusPending, nil - + return structs.JobStatusRunning, nil } // The job is dead if all the allocations and evals are terminal or if there diff --git a/nomad/state/state_store_test.go b/nomad/state/state_store_test.go index 54aa73e64dc..1783f1cdbfb 100644 --- a/nomad/state/state_store_test.go +++ b/nomad/state/state_store_test.go @@ -1635,6 +1635,7 @@ func TestStateStore_JobsByScheduler(t *testing.T) { for i := 0; i < 10; i++ { job := mock.SystemJob() + job.Status = structs.JobStatusRunning sysJobs = append(sysJobs, job) err := state.UpsertJob(2000+uint64(i), job)