mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 20:05:42 +03:00
Merge pull request #887 from hashicorp/b-nack-timeout
Fix bug introduced with paused nack timers
This commit is contained in:
@@ -207,11 +207,11 @@ func TestRktDriver_Start_Wait_AllocDir(t *testing.T) {
|
||||
task := &structs.Task{
|
||||
Name: "alpine",
|
||||
Config: map[string]interface{}{
|
||||
"image": "docker://alpine",
|
||||
"command": "/bin/sh",
|
||||
"args": []string{
|
||||
"-c",
|
||||
fmt.Sprintf(`echo -n %s > ${%s}/%s`, string(exp), env.AllocDir, file),
|
||||
"image": "docker://alpine",
|
||||
"command": "/bin/sh",
|
||||
"args": []string{
|
||||
"-c",
|
||||
fmt.Sprintf(`echo -n %s > ${%s}/%s`, string(exp), env.AllocDir, file),
|
||||
},
|
||||
},
|
||||
LogConfig: &structs.LogConfig{
|
||||
@@ -247,13 +247,13 @@ func TestRktDriver_Start_Wait_AllocDir(t *testing.T) {
|
||||
}
|
||||
|
||||
// Check that data was written to the shared alloc directory.
|
||||
outputFile := filepath.Join(execCtx.AllocDir.SharedDir, file)
|
||||
act, err := ioutil.ReadFile(outputFile)
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't read expected output: %v", err)
|
||||
}
|
||||
outputFile := filepath.Join(execCtx.AllocDir.SharedDir, file)
|
||||
act, err := ioutil.ReadFile(outputFile)
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't read expected output: %v", err)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(act, exp) {
|
||||
t.Fatalf("Command output is %v; expected %v", act, exp)
|
||||
}
|
||||
if !reflect.DeepEqual(act, exp) {
|
||||
t.Fatalf("Command output is %v; expected %v", act, exp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,14 +59,6 @@ func (s *Server) planApply() {
|
||||
return
|
||||
}
|
||||
|
||||
// Verify the evaluation is outstanding, and that the tokens match.
|
||||
if err := s.evalBroker.OutstandingReset(pending.plan.EvalID, pending.plan.EvalToken); err != nil {
|
||||
s.logger.Printf("[ERR] nomad: plan rejected for evaluation %s: %v",
|
||||
pending.plan.EvalID, err)
|
||||
pending.respond(nil, err)
|
||||
continue
|
||||
}
|
||||
|
||||
// Check if out last plan has completed
|
||||
select {
|
||||
case <-waitCh:
|
||||
|
||||
Reference in New Issue
Block a user