Skip to content

Commit 22aa77a

Browse files
authored
GODRIVER-2328 Upgrade all Evergreen CI test runners to Go 1.17 (#939)
1 parent 189a713 commit 22aa77a

File tree

6 files changed

+59
-134
lines changed

6 files changed

+59
-134
lines changed

.evergreen/config.yml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ tasks:
16801680
commands:
16811681
- func: run-make
16821682
vars:
1683-
targets: "build build-tests"
1683+
targets: "build"
16841684
BUILD_ENV: "PATH=/opt/golang/go1.10/bin:$PATH GOROOT=/opt/golang/go1.10"
16851685

16861686
# Build with whatever the latest Go version is that we're using for tests
@@ -1898,6 +1898,7 @@ axes:
18981898
display_name: "Ubuntu 14.04"
18991899
run_on: ubuntu1404-test
19001900
variables:
1901+
# The latest Go version available on the Ubuntu 14.04 Evergreen CI image is Go 1.16.
19011902
GO_DIST: "/opt/golang/go1.16"
19021903
# The GCC toolchain that comes with Ubuntu 14.04 is incompatible with the standard binary
19031904
# release of Go 1.16. As a result, Cgo builds on Ubuntu 14.04 fail with a linking error
@@ -1911,88 +1912,88 @@ axes:
19111912
- id: os-ssl-32
19121913
display_name: OS
19131914
values:
1914-
- id: "windows-64-go-1-16"
1915+
- id: "windows-64-go-1-17"
19151916
display_name: "Windows 64-bit"
19161917
run_on:
19171918
- windows-64-vs2017-test
19181919
variables:
19191920
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
1920-
GO_DIST: "C:\\golang\\go1.16"
1921+
GO_DIST: "C:\\golang\\go1.17"
19211922
PYTHON3_BINARY: "C:/python/Python38/python.exe"
19221923
VENV_BIN_DIR: "Scripts"
1923-
- id: "ubuntu1604-64-go-1-16"
1924+
- id: "ubuntu1604-64-go-1-17"
19241925
display_name: "Ubuntu 16.04"
19251926
run_on: ubuntu1604-build
19261927
variables:
1927-
GO_DIST: "/opt/golang/go1.16"
1928+
GO_DIST: "/opt/golang/go1.17"
19281929
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
1929-
- id: "osx-go-1-16"
1930+
- id: "osx-go-1-17"
19301931
display_name: "MacOS 10.14"
19311932
run_on: macos-1014
19321933
variables:
1933-
GO_DIST: "/opt/golang/go1.16"
1934+
GO_DIST: "/opt/golang/go1.17"
19341935
PYTHON3_BINARY: python3
19351936

19361937
# OSes that require >= 4.0 for SSL
19371938
- id: os-ssl-40
19381939
display_name: OS
19391940
values:
1940-
- id: "windows-64-go-1-16"
1941+
- id: "windows-64-go-1-17"
19411942
display_name: "Windows 64-bit"
19421943
run_on:
19431944
- windows-64-vs2017-test
19441945
variables:
19451946
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
1946-
GO_DIST: "C:\\golang\\go1.16"
1947+
GO_DIST: "C:\\golang\\go1.17"
19471948
PYTHON3_BINARY: "C:/python/Python38/python.exe"
19481949
VENV_BIN_DIR: "Scripts"
1949-
- id: "ubuntu1804-64-go-1-16"
1950+
- id: "ubuntu1804-64-go-1-17"
19501951
display_name: "Ubuntu 18.04"
19511952
run_on: ubuntu1804-build
19521953
variables:
1953-
GO_DIST: "/opt/golang/go1.16"
1954+
GO_DIST: "/opt/golang/go1.17"
19541955
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
1955-
- id: "osx-go-1-16"
1956+
- id: "osx-go-1-17"
19561957
display_name: "MacOS 10.14"
19571958
run_on: macos-1014
19581959
variables:
1959-
GO_DIST: "/opt/golang/go1.16"
1960+
GO_DIST: "/opt/golang/go1.17"
19601961
PYTHON3_BINARY: python3
19611962

19621963
# OCSP linux tasks need to run against this OS since stapling is disabled on Ubuntu 18.04 (SERVER-51364)
19631964
- id: ocsp-rhel-70
19641965
display_name: OS
19651966
values:
1966-
- id: "rhel70-go-1-16"
1967+
- id: "rhel70-go-1-17"
19671968
display_name: "RHEL 7.0"
19681969
run_on: rhel70-build
19691970
variables:
1970-
GO_DIST: "/opt/golang/go1.16"
1971+
GO_DIST: "/opt/golang/go1.17"
19711972
PYTHON3_BINARY: "/opt/python/3.6/bin/python3"
19721973

19731974
- id: os-aws-auth
19741975
display_name: OS
19751976
values:
1976-
- id: "windows-64-vsMulti-small-go-1-16"
1977+
- id: "windows-64-vsMulti-small-go-1-17"
19771978
display_name: "Windows 64-bit"
19781979
run_on:
19791980
- windows-64-vsMulti-small
19801981
variables:
19811982
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
1982-
GO_DIST: "C:\\golang\\go1.16"
1983+
GO_DIST: "C:\\golang\\go1.17"
19831984
SKIP_ECS_AUTH_TEST: true
19841985
PYTHON3: "C:/python/Python38/python.exe"
1985-
- id: "ubuntu1804-64-go-1-16"
1986+
- id: "ubuntu1804-64-go-1-17"
19861987
display_name: "Ubuntu 18.04"
19871988
run_on: ubuntu1804-test
19881989
variables:
1989-
GO_DIST: "/opt/golang/go1.16"
1990+
GO_DIST: "/opt/golang/go1.17"
19901991
PYTHON3: python3
1991-
- id: "osx-go-1-16"
1992+
- id: "osx-go-1-17"
19921993
display_name: "MacOS 10.14"
19931994
run_on: macos-1014
19941995
variables:
1995-
GO_DIST: "/opt/golang/go1.16"
1996+
GO_DIST: "/opt/golang/go1.17"
19961997
SKIP_ECS_AUTH_TEST: true
19971998
SKIP_EC2_AUTH_TEST: true
19981999
PYTHON3: python3
@@ -2054,7 +2055,7 @@ buildvariants:
20542055
run_on:
20552056
- ubuntu1804-build
20562057
expansions:
2057-
GO_DIST: "/opt/golang/go1.16"
2058+
GO_DIST: "/opt/golang/go1.17"
20582059
tasks:
20592060
- name: ".static-analysis"
20602061

@@ -2063,7 +2064,7 @@ buildvariants:
20632064
run_on:
20642065
- ubuntu1804-build
20652066
expansions:
2066-
GO_DIST: "/opt/golang/go1.16"
2067+
GO_DIST: "/opt/golang/go1.17"
20672068
tasks:
20682069
- name: ".performance"
20692070

@@ -2072,7 +2073,7 @@ buildvariants:
20722073
run_on:
20732074
- ubuntu1804-test
20742075
expansions:
2075-
GO_DIST: "/opt/golang/go1.16"
2076+
GO_DIST: "/opt/golang/go1.17"
20762077
tasks:
20772078
- name: ".compile-check"
20782079

@@ -2081,7 +2082,7 @@ buildvariants:
20812082
run_on:
20822083
- ubuntu1804-build
20832084
expansions:
2084-
GO_DIST: "/opt/golang/go1.16"
2085+
GO_DIST: "/opt/golang/go1.17"
20852086
tasks:
20862087
- name: "atlas-test"
20872088

@@ -2090,7 +2091,7 @@ buildvariants:
20902091
run_on:
20912092
- ubuntu1804-build
20922093
expansions:
2093-
GO_DIST: "/opt/golang/go1.16"
2094+
GO_DIST: "/opt/golang/go1.17"
20942095
tasks:
20952096
- name: "test-atlas-data-lake"
20962097

@@ -2149,22 +2150,22 @@ buildvariants:
21492150
- name: "aws-auth-test"
21502151

21512152
- matrix_name: "ocsp-test"
2152-
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], ocsp-rhel-70: ["rhel70-go-1-16"] }
2153+
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], ocsp-rhel-70: ["rhel70-go-1-17"] }
21532154
display_name: "OCSP ${version} ${ocsp-rhel-70}"
21542155
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
21552156
tasks:
21562157
- name: ".ocsp"
21572158

21582159
- matrix_name: "ocsp-test-windows"
2159-
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["windows-64-go-1-16"] }
2160+
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["windows-64-go-1-17"] }
21602161
display_name: "OCSP ${version} ${os-ssl-40}"
21612162
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
21622163
tasks:
21632164
# Windows MongoDB servers do not staple OCSP responses and only support RSA.
21642165
- name: ".ocsp-rsa !.ocsp-staple"
21652166

21662167
- matrix_name: "ocsp-test-macos"
2167-
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["osx-go-1-16"] }
2168+
matrix_spec: { version: ["4.4", "5.0", "6.0", "latest"], os-ssl-40: ["osx-go-1-17"] }
21682169
display_name: "OCSP ${version} ${os-ssl-40}"
21692170
batchtime: 20160 # Use a batchtime of 14 days as suggested by the OCSP test README
21702171
tasks:
@@ -2178,7 +2179,7 @@ buildvariants:
21782179
- name: ".versioned-api"
21792180

21802181
- matrix_name: "kms-tls-test"
2181-
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-16"] }
2182+
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-17"] }
21822183
display_name: "KMS TLS ${os-ssl-40}"
21832184
tasks:
21842185
- name: ".kms-tls"
@@ -2188,19 +2189,19 @@ buildvariants:
21882189
# The new "loadBalancerPort" option is supported starting with server 5.2, which responds
21892190
# correctly to "hello" commands with a service ID when behind a load balancer. Only run load
21902191
# balancer tests on server 5.2+ ("rapid", "latest" are always 5.2+).
2191-
matrix_spec: { version: ["rapid", "latest"], os-ssl-40: ["ubuntu1804-64-go-1-16"] }
2192+
matrix_spec: { version: ["rapid", "latest"], os-ssl-40: ["ubuntu1804-64-go-1-17"] }
21922193
display_name: "Load Balancer Support ${version} ${os-ssl-40}"
21932194
tasks:
21942195
- name: ".load-balancer"
21952196

21962197
- matrix_name: "serverless"
2197-
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-16"] }
2198+
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-17"] }
21982199
display_name: "Serverless ${os-ssl-40}"
21992200
tasks:
22002201
- "serverless_task_group"
22012202

22022203
- matrix_name: "kms-kmip-test"
2203-
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-16"] }
2204+
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-17"] }
22042205
display_name: "KMS KMIP ${os-ssl-40}"
22052206
tasks:
22062207
- name: ".kms-kmip"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Before starting to write code, look for existing [tickets](https://jira.mongodb.
1313
The Go Driver team uses GitHub to manage and review all code changes. Patches should generally be made against the master (default) branch and include relevant tests, if
1414
applicable.
1515

16-
Code should compile and tests should pass under all Go versions which the driver currently supports. Currently the Go Driver supports a minimum version of Go 1.10 and requires Go 1.16 for development. Please run the following Make targets to validate your changes:
16+
Code should compile and tests should pass under all Go versions which the driver currently supports. Currently the Go Driver supports a minimum version of Go 1.10 and requires Go 1.17 for development. Please run the following Make targets to validate your changes:
1717
- `make fmt`
1818
- `make lint` (requires [golangci-lint](https://github.com/golangci/golangci-lint) and [lll](https://github.com/walle/lll) to be installed and available in the `PATH`)
1919
- `make test`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ The MongoDB supported driver for Go.
2222
-------------------------
2323
## Requirements
2424

25-
- Go 1.10 or higher if using the driver as a dependency. Go 1.16 or higher if building the driver yourself. We aim to support the latest supported versions of go.
25+
- Go 1.10 or higher if using the driver as a dependency. Go 1.17 or higher if building the driver yourself. We aim to support the latest versions of Go.
2626
- MongoDB 2.6 and higher.
2727

2828
-------------------------
2929
## Installation
3030

31-
The recommended way to get started using the MongoDB Go driver is by using go modules to install the dependency in
31+
The recommended way to get started using the MongoDB Go driver is by using Go modules to install the dependency in
3232
your project. This can be done either by importing packages from `go.mongodb.org/mongo-driver` and having the build
3333
step install the dependency or by explicitly running
3434

x/mongo/driver/topology/connection_test.go

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -251,28 +251,22 @@ func TestConnection(t *testing.T) {
251251
// Ensure the TLS handshake can be timed out and the connection propagates the error from the
252252
// tlsConn in this case.
253253

254-
var hangingTLSConnectionSource tlsConnectionSourceFn = func(nc net.Conn, cfg *tls.Config) tlsConn {
255-
tlsConn := tls.Client(nc, cfg)
256-
return newHangingTLSConn(tlsConn, tc.maxConnectTime)
257-
}
254+
// Start a TCP listener on a random port and use the listener address as the
255+
// target for connections. The listener will act as a source of connections
256+
// that never respond, allowing the timeout logic to always trigger.
257+
l, err := net.Listen("tcp", "localhost:0")
258+
assert.Nil(t, err, "net.Listen() error: %q", err)
259+
defer l.Close()
258260

259261
connOpts := []ConnectionOption{
260262
WithConnectTimeout(func(time.Duration) time.Duration {
261263
return tc.connectTimeout
262264
}),
263-
WithDialer(func(Dialer) Dialer {
264-
return DialerFunc(func(context.Context, string, string) (net.Conn, error) {
265-
return &net.TCPConn{}, nil
266-
})
267-
}),
268265
WithTLSConfig(func(*tls.Config) *tls.Config {
269266
return &tls.Config{ServerName: "test"}
270267
}),
271-
withTLSConnectionSource(func(tlsConnectionSource) tlsConnectionSource {
272-
return hangingTLSConnectionSource
273-
}),
274268
}
275-
conn := newConnection("", connOpts...)
269+
conn := newConnection(address.Address(l.Addr().String()), connOpts...)
276270

277271
ctx, cancel := context.WithTimeout(context.Background(), tc.contextTimeout)
278272
defer cancel()
@@ -284,8 +278,20 @@ func TestConnection(t *testing.T) {
284278

285279
ce, ok := connectErr.(ConnectionError)
286280
assert.True(t, ok, "expected error %v to be of type %T", connectErr, ConnectionError{})
287-
assert.Equal(t, context.DeadlineExceeded, ce.Unwrap(), "expected wrapped error to be %v, got %v",
288-
context.DeadlineExceeded, ce.Unwrap())
281+
282+
isTimeout := func(err error) bool {
283+
if err == context.DeadlineExceeded {
284+
return true
285+
}
286+
if ne, ok := err.(net.Error); ok {
287+
return ne.Timeout()
288+
}
289+
return false
290+
}
291+
assert.True(t,
292+
isTimeout(ce.Unwrap()),
293+
"expected wrapped error to be a timeout error, but got %q",
294+
ce.Unwrap())
289295
})
290296
t.Run("timeout is not applied to handshaker: "+tc.name, func(t *testing.T) {
291297
// Ensure that no additional timeout is applied to the handshake after the connection has been
@@ -318,8 +324,7 @@ func TestConnection(t *testing.T) {
318324
}
319325
conn := newConnection("", connOpts...)
320326

321-
bgCtx := context.Background()
322-
err := conn.connect(bgCtx)
327+
err := conn.connect(context.Background())
323328
assert.Nil(t, err, "connect error: %v", err)
324329

325330
assertNoContextTimeout := func(t *testing.T, ctx context.Context) {

x/mongo/driver/topology/hanging_tls_conn_1_16.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)