Merge pull request #175 from nelhage/fix-tests

Fix some issues in tests.
This commit is contained in:
William Tisäter 2014-05-26 22:38:27 +02:00
commit f5bd176fb3
2 changed files with 2 additions and 2 deletions

View File

@ -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),
}

View File

@ -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)
})