mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 08:56:43 +00:00
api: make node health test more reliable
This commit is contained in:
parent
c291acd96e
commit
78328ec149
@ -20,17 +20,21 @@ func TestHealth_Node(t *testing.T) {
|
|||||||
}
|
}
|
||||||
name := info["Config"]["NodeName"].(string)
|
name := info["Config"]["NodeName"].(string)
|
||||||
|
|
||||||
checks, meta, err := health.Node(name, nil)
|
testutil.WaitForResult(func() (bool, error) {
|
||||||
if err != nil {
|
checks, meta, err := health.Node(name, nil)
|
||||||
t.Fatalf("err: %v", err)
|
if err != nil {
|
||||||
}
|
return false, err
|
||||||
|
}
|
||||||
if meta.LastIndex == 0 {
|
if meta.LastIndex == 0 {
|
||||||
t.Fatalf("bad: %v", meta)
|
return false, fmt.Errorf("bad: %v", meta)
|
||||||
}
|
}
|
||||||
if len(checks) == 0 {
|
if len(checks) == 0 {
|
||||||
t.Fatalf("Bad: %v", checks)
|
return false, fmt.Errorf("bad: %v", checks)
|
||||||
}
|
}
|
||||||
|
return true, nil
|
||||||
|
}, func(err error) {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHealth_Checks(t *testing.T) {
|
func TestHealth_Checks(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user