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 // Verify the old leader is deregistered
state := remain.fsm.State() state := remain.fsm.State()
_, found, _ := state.GetNode(leader.config.NodeName) testutil.WaitForResult(func() (bool, error) {
if found { _, found, _ := state.GetNode(leader.config.NodeName)
return !found, nil
}, func(err error) {
t.Fatalf("leader should be deregistered") t.Fatalf("leader should be deregistered")
} })
} }
func TestLeader_MultiBootstrap(t *testing.T) { func TestLeader_MultiBootstrap(t *testing.T) {