Skip to content

Commit b473d1b

Browse files
GODRIVER-3313 [release/1.17] Skip CSOT spec tests on Windows and macOS. (#1838)
Co-authored-by: Matt Dale <[email protected]>
1 parent c0afeee commit b473d1b

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.evergreen/config.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ functions:
383383
params:
384384
shell: "bash"
385385
working_dir: src/go.mongodb.org/mongo-driver
386-
include_expansions_in_env: ["TOPOLOGY", "AUTH", "SSL", "MONGODB_URI", "CRYPT_SHARED_LIB_PATH", "SKIP_CRYPT_SHARED_LIB", "RACE", "MONGO_GO_DRIVER_COMPRESSOR", "REQUIRE_API_VERSION", "LOAD_BALANCER"]
386+
include_expansions_in_env: ["TOPOLOGY", "AUTH", "SSL", "SKIP_CSOT_TESTS", "MONGODB_URI", "CRYPT_SHARED_LIB_PATH", "SKIP_CRYPT_SHARED_LIB", "RACE", "MONGO_GO_DRIVER_COMPRESSOR", "REQUIRE_API_VERSION", "LOAD_BALANCER"]
387387
script: |
388388
${PREPARE_SHELL}
389389
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
@@ -2096,6 +2096,8 @@ axes:
20962096
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
20972097
GO_DIST: "C:\\golang\\go1.22"
20982098
VENV_BIN_DIR: "Scripts"
2099+
# CSOT tests are unreliable on our slow Windows hosts.
2100+
SKIP_CSOT_TESTS: true
20992101
- id: "rhel87-64"
21002102
display_name: "RHEL 8.7"
21012103
run_on: rhel8.7-large
@@ -2107,6 +2109,8 @@ axes:
21072109
batchtime: 1440 # Run at most once per 24 hours.
21082110
variables:
21092111
GO_DIST: "/opt/golang/go1.22"
2112+
# CSOT tests are unreliable on our slow macOS hosts.
2113+
SKIP_CSOT_TESTS: true
21102114

21112115
# OSes that require >= 4.0 for SSL
21122116
- id: os-ssl-40
@@ -2120,6 +2124,8 @@ axes:
21202124
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21212125
GO_DIST: "C:\\golang\\go1.22"
21222126
VENV_BIN_DIR: "Scripts"
2127+
# CSOT tests are unreliable on our slow Windows hosts.
2128+
SKIP_CSOT_TESTS: true
21232129
- id: "rhel87-64"
21242130
display_name: "RHEL 8.7"
21252131
run_on: rhel8.7-large
@@ -2131,6 +2137,8 @@ axes:
21312137
batchtime: 1440 # Run at most once per 24 hours.
21322138
variables:
21332139
GO_DIST: "/opt/golang/go1.22"
2140+
# CSOT tests are unreliable on our slow macOS hosts.
2141+
SKIP_CSOT_TESTS: true
21342142

21352143
- id: ocsp-rhel-87
21362144
display_name: OS
@@ -2152,6 +2160,8 @@ axes:
21522160
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21532161
GO_DIST: "C:\\golang\\go1.22"
21542162
SKIP_ECS_AUTH_TEST: true
2163+
# CSOT tests are unreliable on our slow Windows hosts.
2164+
SKIP_CSOT_TESTS: true
21552165
- id: "ubuntu2004-64"
21562166
display_name: "Ubuntu 20.04"
21572167
run_on: ubuntu2004-test
@@ -2166,6 +2176,8 @@ axes:
21662176
SKIP_ECS_AUTH_TEST: true
21672177
SKIP_EC2_AUTH_TEST: true
21682178
SKIP_WEB_IDENTITY_AUTH_TEST: true
2179+
# CSOT tests are unreliable on our slow macOS hosts.
2180+
SKIP_CSOT_TESTS: true
21692181

21702182
- id: os-faas-80
21712183
display_name: OS

.evergreen/run-tests.sh

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ fi
8787

8888
AUTH=${AUTH} \
8989
SSL=${SSL} \
90+
SKIP_CSOT_TESTS=${SKIP_CSOT_TESTS} \
9091
MONGO_GO_DRIVER_CA_FILE=${MONGO_GO_DRIVER_CA_FILE} \
9192
MONGO_GO_DRIVER_KEY_FILE=${MONGO_GO_DRIVER_KEY_FILE} \
9293
MONGO_GO_DRIVER_PKCS8_ENCRYPTED_KEY_FILE=${MONGO_GO_DRIVER_PKCS8_ENCRYPTED_KEY_FILE} \

mongo/integration/csot_prose_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package integration
88

99
import (
1010
"context"
11+
"os"
1112
"strings"
1213
"testing"
1314
"time"
@@ -22,6 +23,13 @@ import (
2223
)
2324

2425
func TestCSOTProse(t *testing.T) {
26+
// Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set
27+
// that environment variable on Windows and macOS because the CSOT spec
28+
// tests are unreliable on those hosts.
29+
if os.Getenv("SKIP_CSOT_TESTS") == "true" {
30+
t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true")
31+
}
32+
2533
mt := mtest.New(t, mtest.NewOptions().CreateClient(false))
2634

2735
mt.RunOpts("1. multi-batch writes", mtest.NewOptions().MinServerVersion("4.4").

mongo/integration/csot_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package integration
99
import (
1010
"context"
1111
"errors"
12+
"os"
1213
"testing"
1314
"time"
1415

@@ -27,6 +28,13 @@ import (
2728
// Test automatic "maxTimeMS" appending and connection closing behavior when
2829
// CSOT is disabled and enabled.
2930
func TestCSOT_maxTimeMS(t *testing.T) {
31+
// Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set
32+
// that environment variable on Windows and macOS because the CSOT spec
33+
// tests are unreliable on those hosts.
34+
if os.Getenv("SKIP_CSOT_TESTS") == "true" {
35+
t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true")
36+
}
37+
3038
mt := mtest.New(t, mtest.NewOptions().CreateClient(false))
3139

3240
testCases := []struct {
@@ -586,6 +594,13 @@ func TestCSOT_maxTimeMS(t *testing.T) {
586594
}
587595

588596
func TestCSOT_errors(t *testing.T) {
597+
// Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set
598+
// that environment variable on Windows and macOS because the CSOT spec
599+
// tests are unreliable on those hosts.
600+
if os.Getenv("SKIP_CSOT_TESTS") == "true" {
601+
t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true")
602+
}
603+
589604
mt := mtest.New(t, mtest.NewOptions().
590605
CreateClient(false).
591606
// Blocking failpoints don't work on pre-4.2 and sharded clusters.

mongo/integration/unified/unified_spec_runner.go

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"context"
1111
"fmt"
1212
"io/ioutil"
13+
"os"
1314
"path"
1415
"strings"
1516
"testing"
@@ -150,6 +151,13 @@ func runTestFile(t *testing.T, filepath string, expectValidFail bool, opts ...*O
150151
CreateClient(false)
151152

152153
mt.RunOpts(testCase.Description, mtOpts, func(mt *mtest.T) {
154+
// Skip CSOT spec tests when SKIP_CSOT_TESTS=true. In Evergreen, we
155+
// typically set that environment variable on Windows and macOS
156+
// because the CSOT spec tests are unreliable on those hosts.
157+
if os.Getenv("SKIP_CSOT_TESTS") == "true" && strings.Contains(filepath, "client-side-operations-timeout") {
158+
mt.Skip("Skipping CSOT spec test because SKIP_CSOT_TESTS=true")
159+
}
160+
153161
defer func() {
154162
// catch panics from looking up elements and fail if it's unexpected
155163
if r := recover(); r != nil {

0 commit comments

Comments
 (0)