mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

Go 1.11 now marks len(channel) over being-closed channel as racey operation, fix tests by receiving from channel first and then check the length of channel. ``` WARNING: DATA RACE Write at 0x00c000e872c0 by goroutine 198: runtime.closechan() /usr/local/go/src/runtime/chan.go:327 +0x0 go.etcd.io/etcd/clientv3.(*lessor).closeRequireLeader() /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:379 +0x748 go.etcd.io/etcd/clientv3.(*lessor).recvKeepAliveLoop() /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:455 +0x3a5 Previous read at 0x00c000e872c0 by goroutine 27: go.etcd.io/etcd/clientv3/integration.TestLeaseWithRequireLeader() /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/integration/lease_test.go:828 +0x810 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 ``` Signed-off-by: Gyuho Lee <leegyuho@amazon.com>