Tweaks leader test now that we have new wait timing.

This commit is contained in:
James Phillips 2017-01-25 22:11:30 -08:00
parent 64c59999e1
commit 84a487526b
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 11 additions and 5 deletions

View File

@ -225,16 +225,22 @@ func TestLeader_ReapMember(t *testing.T) {
}
s1.reconcileCh <- c1mem
// Should be deregistered
testutil.WaitForResult(func() (bool, error) {
// Should be deregistered; we have to poll quickly here because
// anti-entropy will put it back.
reaped := false
for start := time.Now(); time.Since(start) < 5*time.Second; {
_, node, err := state.GetNode(c1.config.NodeName)
if err != nil {
t.Fatalf("err: %v", err)
}
return node == nil, nil
}, func(err error) {
if node == nil {
reaped = true
break
}
}
if !reaped {
t.Fatalf("client should not be registered")
})
}
}
func TestLeader_Reconcile_ReapMember(t *testing.T) {