Skip to content

Commit

Permalink
test fixes and delete
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed May 25, 2016
1 parent 8456f77 commit bd079a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 4 additions & 2 deletions nomad/blocked_evals.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,17 @@ func (b *BlockedEvals) UnblockFailed() {
}

var unblock []*structs.Evaluation
for _, eval := range b.captured {
for id, eval := range b.captured {
if eval.TriggeredBy == structs.EvalTriggerMaxPlans {
unblock = append(unblock, eval)
delete(b.captured, id)
}
}

for _, eval := range b.escaped {
for id, eval := range b.escaped {
if eval.TriggeredBy == structs.EvalTriggerMaxPlans {
unblock = append(unblock, eval)
delete(b.escaped, id)
}
}

Expand Down
9 changes: 2 additions & 7 deletions nomad/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,8 @@ func TestWorker_ReblockEval(t *testing.T) {
t.Fatal(err)
}

// Enqueue the eval
testutil.WaitForResult(func() (bool, error) {
err := s1.evalBroker.Enqueue(eval1)
return err == nil, err
}, func(err error) {
t.Fatalf("err: %v", err)
})
// Enqueue the eval and then dequeue
s1.evalBroker.Enqueue(eval1)
evalOut, token, err := s1.evalBroker.Dequeue([]string{eval1.Type}, time.Second)
if err != nil {
t.Fatalf("err: %v", err)
Expand Down

0 comments on commit bd079a2

Please sign in to comment.