system_sched_test extend the test to check ineligible nodes
This commit is contained in:
parent
c43bcbd35e
commit
c490dacf76
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue