consul: Improving test reliability

This commit is contained in:
Armon Dadgar 2014-10-17 17:40:03 -07:00
parent cc613a90fd
commit f37f5fde54
1 changed files with 5 additions and 3 deletions

View File

@ -390,10 +390,12 @@ func TestLeader_LeftLeader(t *testing.T) {
// Verify the old leader is deregistered
state := remain.fsm.State()
testutil.WaitForResult(func() (bool, error) {
_, found, _ := state.GetNode(leader.config.NodeName)
if found {
return !found, nil
}, func(err error) {
t.Fatalf("leader should be deregistered")
}
})
}
func TestLeader_MultiBootstrap(t *testing.T) {