mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
fix two flaky tests
This commit is contained in:
@@ -265,7 +265,7 @@ func TestRawExecDriver_HandlerExec(t *testing.T) {
|
||||
Driver: "raw_exec",
|
||||
Config: map[string]interface{}{
|
||||
"command": testtask.Path(),
|
||||
"args": []string{"sleep", "9000"},
|
||||
"args": []string{"sleep", "9000s"},
|
||||
},
|
||||
LogConfig: &structs.LogConfig{
|
||||
MaxFiles: 10,
|
||||
@@ -310,6 +310,12 @@ func TestRawExecDriver_HandlerExec(t *testing.T) {
|
||||
t.Fatalf("expected output to contain %q but found: %q", expected, out)
|
||||
}
|
||||
|
||||
select {
|
||||
case res := <-resp.Handle.WaitCh():
|
||||
t.Fatalf("Shouldn't be exited: %v", res.String())
|
||||
default:
|
||||
}
|
||||
|
||||
if err := resp.Handle.Kill(); err != nil {
|
||||
t.Fatalf("error killing exec handle: %v", err)
|
||||
}
|
||||
|
||||
@@ -188,13 +188,13 @@ job "job1" {
|
||||
stdinW.Close()
|
||||
}()
|
||||
|
||||
args := []string{"-"}
|
||||
args := []string{"-address=nope", "-"}
|
||||
if code := cmd.Run(args); code != 1 {
|
||||
t.Fatalf("expected exit code 1, got %d: %q", code, ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "connection refused") {
|
||||
t.Fatalf("expected connection refused error, got: %s", out)
|
||||
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Error submitting job") {
|
||||
t.Fatalf("expected submission error, got: %s", out)
|
||||
}
|
||||
ui.ErrorWriter.Reset()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user