mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge 3d74d64fa2e328322f081aa9dffaabee3250a3ba into c86c93ca2951338115159dcdd20711603044e1f1
This commit is contained in:
commit
af12037042
@ -118,6 +118,21 @@ func TestLeaseKeepAliveOnce(t *testing.T) {
|
||||
if !errors.Is(err, rpctypes.ErrLeaseNotFound) {
|
||||
t.Errorf("expected %v, got %v", rpctypes.ErrLeaseNotFound, err)
|
||||
}
|
||||
|
||||
clus.Members[1].Stop(t)
|
||||
clus.Members[2].Stop(t)
|
||||
|
||||
// wait for election timeout, then member[0] will not have a leader.
|
||||
var (
|
||||
electionTicks = 10
|
||||
tickDuration = 10 * time.Millisecond
|
||||
)
|
||||
time.Sleep(time.Duration(3*electionTicks) * tickDuration)
|
||||
|
||||
_, err = lapi.KeepAliveOnce(context.Background(), resp.ID)
|
||||
if err != rpctypes.ErrNoLeader {
|
||||
t.Errorf("expected %v, got %v", rpctypes.ErrNoLeader, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLeaseKeepAlive(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user