Skip to content

Commit

Permalink
Merge pull request hashicorp#8867 from hashicorp/b-canary-substitution
Browse files Browse the repository at this point in the history
scheduler: Revert requireCanary logic
  • Loading branch information
Mahmood Ali authored and teutat3s committed Dec 9, 2020
1 parent e5d2bff commit 26e98a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scheduler/generic_sched_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5347,7 +5347,7 @@ func TestServiceSched_Migrate_NonCanary(t *testing.T) {
h := NewHarness(t)

node1 := mock.Node()
require.NoError(t, h.State.UpsertNode(structs.MsgTypeTestSetup, h.NextIndex(), node1))
require.NoError(t, h.State.UpsertNode(h.NextIndex(), node1))

job := mock.Job()
job.Stable = true
Expand All @@ -5356,7 +5356,7 @@ func TestServiceSched_Migrate_NonCanary(t *testing.T) {
MaxParallel: 1,
Canary: 1,
}
require.NoError(t, h.State.UpsertJob(structs.MsgTypeTestSetup, h.NextIndex(), job))
require.NoError(t, h.State.UpsertJob(h.NextIndex(), job))

deployment := &structs.Deployment{
ID: uuid.Generate(),
Expand All @@ -5382,7 +5382,7 @@ func TestServiceSched_Migrate_NonCanary(t *testing.T) {
alloc.DesiredStatus = structs.AllocDesiredStatusRun
alloc.ClientStatus = structs.AllocClientStatusRunning
alloc.DesiredTransition.Migrate = helper.BoolToPtr(true)
require.NoError(t, h.State.UpsertAllocs(structs.MsgTypeTestSetup, h.NextIndex(), []*structs.Allocation{alloc}))
require.NoError(t, h.State.UpsertAllocs(h.NextIndex(), []*structs.Allocation{alloc}))

// Create a mock evaluation
eval := &structs.Evaluation{
Expand All @@ -5393,7 +5393,7 @@ func TestServiceSched_Migrate_NonCanary(t *testing.T) {
JobID: job.ID,
Status: structs.EvalStatusPending,
}
require.NoError(t, h.State.UpsertEvals(structs.MsgTypeTestSetup, h.NextIndex(), []*structs.Evaluation{eval}))
require.NoError(t, h.State.UpsertEvals(h.NextIndex(), []*structs.Evaluation{eval}))

// Process the evaluation
err := h.Process(NewServiceScheduler, eval)
Expand Down

0 comments on commit 26e98a7

Please sign in to comment.