Browse Source

Merge pull request #10045 from gyuho/go-1.11

*: use Go 1.11 for tests
Gyuho Lee 7 years ago
parent
commit
1a282a72be

+ 5 - 5
.travis.yml

@@ -6,7 +6,7 @@ sudo: required
 services: docker
 services: docker
 
 
 go:
 go:
-- 1.10.3
+- 1.11
 - tip
 - tip
 
 
 notifications:
 notifications:
@@ -30,13 +30,13 @@ env:
 matrix:
 matrix:
   fast_finish: true
   fast_finish: true
   allow_failures:
   allow_failures:
-  - go: 1.10.3
+  - go: 1.11
     env: TARGET=linux-amd64-grpcproxy
     env: TARGET=linux-amd64-grpcproxy
-  - go: 1.10.3
+  - go: 1.11
     env: TARGET=linux-amd64-coverage
     env: TARGET=linux-amd64-coverage
   - go: tip
   - go: tip
     env: TARGET=linux-amd64-fmt-unit-go-tip
     env: TARGET=linux-amd64-fmt-unit-go-tip
-  - go: 1.10.3
+  - go: 1.11
     env: TARGET=linux-386-unit
     env: TARGET=linux-386-unit
   exclude:
   exclude:
   - go: tip
   - go: tip
@@ -57,7 +57,7 @@ matrix:
     env: TARGET=linux-amd64-grpcproxy
     env: TARGET=linux-amd64-grpcproxy
   - go: tip
   - go: tip
     env: TARGET=linux-amd64-coverage
     env: TARGET=linux-amd64-coverage
-  - go: 1.10.3
+  - go: 1.11
     env: TARGET=linux-amd64-fmt-unit-go-tip
     env: TARGET=linux-amd64-fmt-unit-go-tip
   - go: tip
   - go: tip
     env: TARGET=linux-386-unit
     env: TARGET=linux-386-unit

+ 3 - 3
Makefile

@@ -51,7 +51,7 @@ docker-remove:
 
 
 
 
 
 
-GO_VERSION ?= 1.10.3
+GO_VERSION ?= 1.11
 ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")
 ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")
 
 
 TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
 TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
@@ -65,11 +65,11 @@ endif
 
 
 
 
 # Example:
 # Example:
-#   GO_VERSION=1.8.7 make build-docker-test
+#   GO_VERSION=1.10.3 make build-docker-test
 #   make build-docker-test
 #   make build-docker-test
 #
 #
 #   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
 #   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
-#   GO_VERSION=1.8.7 make push-docker-test
+#   GO_VERSION=1.10.3 make push-docker-test
 #   make push-docker-test
 #   make push-docker-test
 #
 #
 #   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
 #   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com

+ 4 - 1
clientv3/integration/lease_test.go

@@ -825,8 +825,11 @@ func TestLeaseWithRequireLeader(t *testing.T) {
 	// kaReqLeader may issue multiple requests while waiting for the first
 	// kaReqLeader may issue multiple requests while waiting for the first
 	// response from proxy server; drain any stray keepalive responses
 	// response from proxy server; drain any stray keepalive responses
 	time.Sleep(100 * time.Millisecond)
 	time.Sleep(100 * time.Millisecond)
-	for len(kaReqLeader) > 0 {
+	for {
 		<-kaReqLeader
 		<-kaReqLeader
+		if len(kaReqLeader) == 0 {
+			break
+		}
 	}
 	}
 
 
 	select {
 	select {

+ 1 - 1
clientv3/lease.go

@@ -199,7 +199,7 @@ func NewLeaseFromLeaseClient(remote pb.LeaseClient, c *Client, keepAliveTimeout
 		keepAlives:            make(map[LeaseID]*keepAlive),
 		keepAlives:            make(map[LeaseID]*keepAlive),
 		remote:                remote,
 		remote:                remote,
 		firstKeepAliveTimeout: keepAliveTimeout,
 		firstKeepAliveTimeout: keepAliveTimeout,
-		lg: c.lg,
+		lg:                    c.lg,
 	}
 	}
 	if l.firstKeepAliveTimeout == time.Second {
 	if l.firstKeepAliveTimeout == time.Second {
 		l.firstKeepAliveTimeout = defaultTTL
 		l.firstKeepAliveTimeout = defaultTTL

+ 6 - 6
etcdserver/api/v2http/client.go

@@ -76,12 +76,12 @@ func handleV2(lg *zap.Logger, mux *http.ServeMux, server etcdserver.ServerV2, ti
 	}
 	}
 
 
 	mh := &membersHandler{
 	mh := &membersHandler{
-		lg:      lg,
-		sec:     sec,
-		server:  server,
-		cluster: server.Cluster(),
-		timeout: timeout,
-		clock:   clockwork.NewRealClock(),
+		lg:                    lg,
+		sec:                   sec,
+		server:                server,
+		cluster:               server.Cluster(),
+		timeout:               timeout,
+		clock:                 clockwork.NewRealClock(),
 		clientCertAuthEnabled: server.ClientCertAuthEnabled(),
 		clientCertAuthEnabled: server.ClientCertAuthEnabled(),
 	}
 	}
 
 

+ 2 - 2
etcdserver/config_test.go

@@ -196,8 +196,8 @@ func TestWALDir(t *testing.T) {
 
 
 func TestShouldDiscover(t *testing.T) {
 func TestShouldDiscover(t *testing.T) {
 	tests := map[string]bool{
 	tests := map[string]bool{
-		"":    false,
-		"foo": true,
+		"":                              false,
+		"foo":                           true,
 		"http://discovery.etcd.io/asdf": true,
 		"http://discovery.etcd.io/asdf": true,
 	}
 	}
 	for durl, w := range tests {
 	for durl, w := range tests {

+ 4 - 4
functional/agent/server.go

@@ -64,10 +64,10 @@ func NewServer(
 	address string,
 	address string,
 ) *Server {
 ) *Server {
 	return &Server{
 	return &Server{
-		lg:      lg,
-		network: network,
-		address: address,
-		last:    rpcpb.Operation_NOT_STARTED,
+		lg:                         lg,
+		network:                    network,
+		address:                    address,
+		last:                       rpcpb.Operation_NOT_STARTED,
 		advertiseClientPortToProxy: make(map[int]proxy.Server),
 		advertiseClientPortToProxy: make(map[int]proxy.Server),
 		advertisePeerPortToProxy:   make(map[int]proxy.Server),
 		advertisePeerPortToProxy:   make(map[int]proxy.Server),
 	}
 	}

+ 2 - 2
integration/cluster.go

@@ -291,8 +291,8 @@ func (c *cluster) mustNewMember(t *testing.T) *member {
 			grpcKeepAliveTimeout:     c.cfg.GRPCKeepAliveTimeout,
 			grpcKeepAliveTimeout:     c.cfg.GRPCKeepAliveTimeout,
 			clientMaxCallSendMsgSize: c.cfg.ClientMaxCallSendMsgSize,
 			clientMaxCallSendMsgSize: c.cfg.ClientMaxCallSendMsgSize,
 			clientMaxCallRecvMsgSize: c.cfg.ClientMaxCallRecvMsgSize,
 			clientMaxCallRecvMsgSize: c.cfg.ClientMaxCallRecvMsgSize,
-			useIP: c.cfg.UseIP,
-			leaseCheckpointInterval: c.cfg.LeaseCheckpointInterval,
+			useIP:                    c.cfg.UseIP,
+			leaseCheckpointInterval:  c.cfg.LeaseCheckpointInterval,
 		})
 		})
 	m.DiscoveryURL = c.cfg.DiscoveryURL
 	m.DiscoveryURL = c.cfg.DiscoveryURL
 	if c.cfg.UseGRPC {
 	if c.cfg.UseGRPC {

+ 6 - 6
pkg/testutil/leak.go

@@ -70,13 +70,13 @@ func CheckAfterTest(d time.Duration) error {
 	}
 	}
 	var bad string
 	var bad string
 	badSubstring := map[string]string{
 	badSubstring := map[string]string{
-		").writeLoop(":                                 "a Transport",
+		").writeLoop(": "a Transport",
 		"created by net/http/httptest.(*Server).Start": "an httptest.Server",
 		"created by net/http/httptest.(*Server).Start": "an httptest.Server",
-		"timeoutHandler":                               "a TimeoutHandler",
-		"net.(*netFD).connect(":                        "a timing out dial",
-		").noteClientGone(":                            "a closenotifier sender",
-		").readLoop(":                                  "a Transport",
-		".grpc":                                        "a gRPC resource",
+		"timeoutHandler":        "a TimeoutHandler",
+		"net.(*netFD).connect(": "a timing out dial",
+		").noteClientGone(":     "a closenotifier sender",
+		").readLoop(":           "a Transport",
+		".grpc":                 "a gRPC resource",
 	}
 	}
 
 
 	var stacks string
 	var stacks string

+ 4 - 4
proxy/httpproxy/reverse_test.go

@@ -175,10 +175,10 @@ func TestRemoveSingleHopHeaders(t *testing.T) {
 		"Keep-Alive":          {"foo"},
 		"Keep-Alive":          {"foo"},
 		"Proxy-Authenticate":  {"Basic realm=example.com"},
 		"Proxy-Authenticate":  {"Basic realm=example.com"},
 		"Proxy-Authorization": {"foo"},
 		"Proxy-Authorization": {"foo"},
-		"Te":                {"deflate,gzip"},
-		"Trailers":          {"ETag"},
-		"Transfer-Encoding": {"chunked"},
-		"Upgrade":           {"WebSocket"},
+		"Te":                  {"deflate,gzip"},
+		"Trailers":            {"ETag"},
+		"Transfer-Encoding":   {"chunked"},
+		"Upgrade":             {"WebSocket"},
 
 
 		// headers that should persist
 		// headers that should persist
 		"Accept": {"application/json"},
 		"Accept": {"application/json"},