diff --git a/clientv3/integration/leasing_test.go b/clientv3/integration/leasing_test.go index 78826b189..a824726f0 100644 --- a/clientv3/integration/leasing_test.go +++ b/clientv3/integration/leasing_test.go @@ -1790,6 +1790,7 @@ func TestLeasingTxnOwnerPutBranch(t *testing.T) { defer testutil.AfterTest(t) clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3}) defer clus.Terminate(t) + lkv, closeLKV, err := leasing.NewKV(clus.Client(0), "foo/") testutil.AssertNil(t, err) defer closeLKV() diff --git a/etcdserver/server.go b/etcdserver/server.go index 178861745..fc070ce51 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -942,7 +942,10 @@ func (s *EtcdServer) run() { } } if newLeader { - s.leaderChanged <- struct{}{} + select { + case s.leaderChanged <- struct{}{}: + default: + } } // TODO: remove the nil checking // current test utility does not provide the stats