diff --git a/command/agent/check_test.go b/command/agent/check_test.go index 07b4f598d7..19e087c67e 100644 --- a/command/agent/check_test.go +++ b/command/agent/check_test.go @@ -74,7 +74,7 @@ func TestCheckMonitor_LimitOutput(t *testing.T) { check := &CheckMonitor{ Notify: mock, CheckID: "foo", - Script: "dd if=/dev/urandom bs=8192 count=10", + Script: "od -N 81920 /dev/urandom", Interval: 25 * time.Millisecond, Logger: log.New(os.Stderr, "", log.LstdFlags), } diff --git a/testutil/wait.go b/testutil/wait.go index 0bf40937ad..402553352f 100644 --- a/testutil/wait.go +++ b/testutil/wait.go @@ -36,7 +36,7 @@ func WaitForLeader(t *testing.T, rpc rpcFn, dc string) structs.IndexedNodes { Datacenter: dc, } err := rpc("Catalog.ListNodes", args, &out) - return out.QueryMeta.KnownLeader, err + return out.QueryMeta.KnownLeader && out.Index > 0, err }, func(err error) { t.Fatalf("failed to find leader: %v", err) })