Skip to content

Commit

Permalink
ensure that test job.Status is respected
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed Mar 25, 2021
1 parent a4fd0dd commit 14b5511
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,15 @@ func (s *StateStore) upsertJobImpl(index uint64, job *structs.Job, keepVersion b
return fmt.Errorf("job lookup failed: %v", err)
}
if updated != nil {
job = updated.(*structs.Job)

uj := updated.(*structs.Job)

// HACK: Many tests assume that jobs passed to UpsertJob
// is updated the proper Index and Status fields so updating here
job.Status = uj.Status
job.StatusDescription = uj.StatusDescription

job = uj
}
}

Expand Down

0 comments on commit 14b5511

Please sign in to comment.