From c490dacf7624de3f3dd08479a3cf8b24d99473fb Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Tue, 30 Apr 2019 12:45:21 -0400 Subject: [PATCH] system_sched_test extend the test to check ineligible nodes --- scheduler/system_sched_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scheduler/system_sched_test.go b/scheduler/system_sched_test.go index 6e2a51e30..9125a9344 100644 --- a/scheduler/system_sched_test.go +++ b/scheduler/system_sched_test.go @@ -1314,14 +1314,21 @@ func TestSystemSched_Queued_With_Constraints(t *testing.T) { func TestSystemSched_ConstraintErrors(t *testing.T) { h := NewHarness(t) + var node *structs.Node // Register some nodes - for _, tag := range []string{"aaaaaa", "foo", "foo"} { - node := mock.Node() + // the tag "aaaaaa" is hashed so that the nodes are processed + // in an order other than good, good, bad + for _, tag := range []string{"aaaaaa", "foo", "foo", "foo"} { + node = mock.Node() node.Meta["tag"] = tag node.ComputeClass() require.Nil(t, h.State.UpsertNode(h.NextIndex(), node)) } + // Mark the last node as ineligible + node.SchedulingEligibility = structs.NodeSchedulingIneligible + // node.ComputeClass() // should only need to be updated at registration? + // Make a job with a partially matching constraint job := mock.SystemJob() job.Constraints = append(job.Constraints,