mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 00:45:43 +03:00
it is possible to have more than 1 eval if the eval fails, use the last one
This commit is contained in:
@@ -281,9 +281,11 @@ func TestJobs_Evaluations(t *testing.T) {
|
||||
}
|
||||
assertQueryMeta(t, qm)
|
||||
|
||||
// Check that we got the evals back
|
||||
if n := len(evals); n == 0 || evals[0].ID != evalID {
|
||||
t.Fatalf("expected 1 eval (%s), got: %#v", evalID, evals)
|
||||
// Check that we got the evals back, evals are in order most recent to least recent
|
||||
// so the last eval is the original registered eval
|
||||
idx := len(evals) - 1
|
||||
if n := len(evals); n == 0 || evals[idx].ID != evalID {
|
||||
t.Fatalf("expected >= 1 eval (%s), got: %#v", evalID, evals[idx])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user