Skip to content

Commit

Permalink
GODRIVER-2328 Upgrade all Evergreen CI test runners to Go 1.17 (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale authored May 11, 2022
1 parent 189a713 commit 22aa77a
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 134 deletions.
67 changes: 34 additions & 33 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ tasks:
commands:
- func: run-make
vars:
targets: "build build-tests"
targets: "build"
BUILD_ENV: "PATH=/opt/golang/go1.10/bin:$PATH GOROOT=/opt/golang/go1.10"

# Build with whatever the latest Go version is that we're using for tests
Expand Down Expand Up @@ -1898,6 +1898,7 @@ axes:
display_name: "Ubuntu 14.04"
run_on: ubuntu1404-test
variables:
# The latest Go version available on the Ubuntu 14.04 Evergreen CI image is Go 1.16.
GO_DIST: "/opt/golang/go1.16"
# The GCC toolchain that comes with Ubuntu 14.04 is incompatible with the standard binary
# release of Go 1.16. As a result, Cgo builds on Ubuntu 14.04 fail with a linking error
Expand All @@ -1911,88 +1912,88 @@ axes:
- id: os-ssl-32
display_name: OS
values:
- id: "windows-64-go-1-16"
- id: "windows-64-go-1-17"
display_name: "Windows 64-bit"
run_on:
- windows-64-vs2017-test
variables:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.16"
GO_DIST: "C:\\golang\\go1.17"
PYTHON3_BINARY: "C:/python/Python38/python.exe"
VENV_BIN_DIR: "Scripts"
- id: "ubuntu1604-64-go-1-16"
- id: "ubuntu1604-64-go-1-17"
display_name: "Ubuntu 16.04"
run_on: ubuntu1604-build
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
- id: "osx-go-1-16"
- id: "osx-go-1-17"
display_name: "MacOS 10.14"
run_on: macos-1014
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3_BINARY: python3

# OSes that require >= 4.0 for SSL
- id: os-ssl-40
display_name: OS
values:
- id: "windows-64-go-1-16"
- id: "windows-64-go-1-17"
display_name: "Windows 64-bit"
run_on:
- windows-64-vs2017-test
variables:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.16"
GO_DIST: "C:\\golang\\go1.17"
PYTHON3_BINARY: "C:/python/Python38/python.exe"
VENV_BIN_DIR: "Scripts"
- id: "ubuntu1804-64-go-1-16"
- id: "ubuntu1804-64-go-1-17"
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-build
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
- id: "osx-go-1-16"
- id: "osx-go-1-17"
display_name: "MacOS 10.14"
run_on: macos-1014
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3_BINARY: python3

# OCSP linux tasks need to run against this OS since stapling is disabled on Ubuntu 18.04 (SERVER-51364)
- id: ocsp-rhel-70
display_name: OS
values:
- id: "rhel70-go-1-16"
- id: "rhel70-go-1-17"
display_name: "RHEL 7.0"
run_on: rhel70-build
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3_BINARY: "/opt/python/3.6/bin/python3"

- id: os-aws-auth
display_name: OS
values:
- id: "windows-64-vsMulti-small-go-1-16"
- id: "windows-64-vsMulti-small-go-1-17"
display_name: "Windows 64-bit"
run_on:
- windows-64-vsMulti-small
variables:
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
GO_DIST: "C:\\golang\\go1.16"
GO_DIST: "C:\\golang\\go1.17"
SKIP_ECS_AUTH_TEST: true
PYTHON3: "C:/python/Python38/python.exe"
- id: "ubuntu1804-64-go-1-16"
- id: "ubuntu1804-64-go-1-17"
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-test
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
PYTHON3: python3
- id: "osx-go-1-16"
- id: "osx-go-1-17"
display_name: "MacOS 10.14"
run_on: macos-1014
variables:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
SKIP_ECS_AUTH_TEST: true
SKIP_EC2_AUTH_TEST: true
PYTHON3: python3
Expand Down Expand Up @@ -2054,7 +2055,7 @@ buildvariants:
run_on:
- ubuntu1804-build
expansions:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
tasks:
- name: ".static-analysis"

Expand All @@ -2063,7 +2064,7 @@ buildvariants:
run_on:
- ubuntu1804-build
expansions:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
tasks:
- name: ".performance"

Expand All @@ -2072,7 +2073,7 @@ buildvariants:
run_on:
- ubuntu1804-test
expansions:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
tasks:
- name: ".compile-check"

Expand All @@ -2081,7 +2082,7 @@ buildvariants:
run_on:
- ubuntu1804-build
expansions:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
tasks:
- name: "atlas-test"

Expand All @@ -2090,7 +2091,7 @@ buildvariants:
run_on:
- ubuntu1804-build
expansions:
GO_DIST: "/opt/golang/go1.16"
GO_DIST: "/opt/golang/go1.17"
tasks:
- name: "test-atlas-data-lake"

Expand Down Expand Up @@ -2149,22 +2150,22 @@ buildvariants:
- name: "aws-auth-test"

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

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

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

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

- matrix_name: "serverless"
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-16"] }
matrix_spec: { os-ssl-40: ["ubuntu1804-64-go-1-17"] }
display_name: "Serverless ${os-ssl-40}"
tasks:
- "serverless_task_group"

- matrix_name: "kms-kmip-test"
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-16"] }
matrix_spec: { version: ["latest"], os-ssl-40: ["ubuntu1804-64-go-1-17"] }
display_name: "KMS KMIP ${os-ssl-40}"
tasks:
- name: ".kms-kmip"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Before starting to write code, look for existing [tickets](https://jira.mongodb.
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
applicable.

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:
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:
- `make fmt`
- `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`)
- `make test`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ The MongoDB supported driver for Go.
-------------------------
## Requirements

- 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.
- 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.
- MongoDB 2.6 and higher.

-------------------------
## Installation

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

Expand Down
39 changes: 22 additions & 17 deletions x/mongo/driver/topology/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,22 @@ func TestConnection(t *testing.T) {
// Ensure the TLS handshake can be timed out and the connection propagates the error from the
// tlsConn in this case.

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

connOpts := []ConnectionOption{
WithConnectTimeout(func(time.Duration) time.Duration {
return tc.connectTimeout
}),
WithDialer(func(Dialer) Dialer {
return DialerFunc(func(context.Context, string, string) (net.Conn, error) {
return &net.TCPConn{}, nil
})
}),
WithTLSConfig(func(*tls.Config) *tls.Config {
return &tls.Config{ServerName: "test"}
}),
withTLSConnectionSource(func(tlsConnectionSource) tlsConnectionSource {
return hangingTLSConnectionSource
}),
}
conn := newConnection("", connOpts...)
conn := newConnection(address.Address(l.Addr().String()), connOpts...)

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

ce, ok := connectErr.(ConnectionError)
assert.True(t, ok, "expected error %v to be of type %T", connectErr, ConnectionError{})
assert.Equal(t, context.DeadlineExceeded, ce.Unwrap(), "expected wrapped error to be %v, got %v",
context.DeadlineExceeded, ce.Unwrap())

isTimeout := func(err error) bool {
if err == context.DeadlineExceeded {
return true
}
if ne, ok := err.(net.Error); ok {
return ne.Timeout()
}
return false
}
assert.True(t,
isTimeout(ce.Unwrap()),
"expected wrapped error to be a timeout error, but got %q",
ce.Unwrap())
})
t.Run("timeout is not applied to handshaker: "+tc.name, func(t *testing.T) {
// Ensure that no additional timeout is applied to the handshake after the connection has been
Expand Down Expand Up @@ -318,8 +324,7 @@ func TestConnection(t *testing.T) {
}
conn := newConnection("", connOpts...)

bgCtx := context.Background()
err := conn.connect(bgCtx)
err := conn.connect(context.Background())
assert.Nil(t, err, "connect error: %v", err)

assertNoContextTimeout := func(t *testing.T, ctx context.Context) {
Expand Down
37 changes: 0 additions & 37 deletions x/mongo/driver/topology/hanging_tls_conn_1_16.go

This file was deleted.

Loading

0 comments on commit 22aa77a

Please sign in to comment.