relax timing
This commit is contained in:
parent
9ef23ff277
commit
7e69d16c15
|
@ -82,16 +82,20 @@ func TestAPI_OperatorAutopilotServerHealth(t *testing.T) {
|
||||||
defer s.Stop()
|
defer s.Stop()
|
||||||
|
|
||||||
operator := c.Operator()
|
operator := c.Operator()
|
||||||
retry.Run(t, func(r *retry.R) {
|
testutil.WaitForResult(func() (bool, error) {
|
||||||
out, _, err := operator.AutopilotServerHealth(nil)
|
out, _, err := operator.AutopilotServerHealth(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.Fatalf("err: %v", err)
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(out.Servers) != 1 ||
|
if len(out.Servers) != 1 ||
|
||||||
!out.Servers[0].Healthy ||
|
!out.Servers[0].Healthy ||
|
||||||
out.Servers[0].Name != fmt.Sprintf("%s.global", s.Config.NodeName) {
|
out.Servers[0].Name != fmt.Sprintf("%s.global", s.Config.NodeName) {
|
||||||
r.Fatalf("bad: %v", out)
|
return false, fmt.Errorf("%v", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}, func(err error) {
|
||||||
|
t.Fatalf("err: %v", err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue