Merge 3d74d64fa2e328322f081aa9dffaabee3250a3ba into c86c93ca2951338115159dcdd20711603044e1f1

This commit is contained in:
Avinesh Tripathi 2024-09-26 22:00:14 +01:00 committed by GitHub
commit af12037042
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {