Skip to content

Commit 8192e81

Browse files
authored
GODRIVER-3313 Skip CSOT spec tests on Windows and macOS. (#1818)
1 parent 5484657 commit 8192e81

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.evergreen/config.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ functions:
377377
params:
378378
shell: "bash"
379379
working_dir: src/go.mongodb.org/mongo-driver
380-
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"]
380+
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"]
381381
script: |
382382
${PREPARE_SHELL}
383383
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
@@ -2090,6 +2090,8 @@ axes:
20902090
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
20912091
GO_DIST: "C:\\golang\\go1.22"
20922092
VENV_BIN_DIR: "Scripts"
2093+
# CSOT tests are unreliable on our slow Windows hosts.
2094+
SKIP_CSOT_TESTS: true
20932095
- id: "rhel87-64"
20942096
display_name: "RHEL 8.7"
20952097
run_on: rhel8.7-large
@@ -2101,6 +2103,8 @@ axes:
21012103
batchtime: 1440 # Run at most once per 24 hours.
21022104
variables:
21032105
GO_DIST: "/opt/golang/go1.22"
2106+
# CSOT tests are unreliable on our slow macOS hosts.
2107+
SKIP_CSOT_TESTS: true
21042108

21052109
# OSes that require >= 4.0 for SSL
21062110
- id: os-ssl-40
@@ -2114,6 +2118,8 @@ axes:
21142118
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21152119
GO_DIST: "C:\\golang\\go1.22"
21162120
VENV_BIN_DIR: "Scripts"
2121+
# CSOT tests are unreliable on our slow Windows hosts.
2122+
SKIP_CSOT_TESTS: true
21172123
- id: "rhel87-64"
21182124
display_name: "RHEL 8.7"
21192125
run_on: rhel8.7-large
@@ -2125,6 +2131,8 @@ axes:
21252131
batchtime: 1440 # Run at most once per 24 hours.
21262132
variables:
21272133
GO_DIST: "/opt/golang/go1.22"
2134+
# CSOT tests are unreliable on our slow macOS hosts.
2135+
SKIP_CSOT_TESTS: true
21282136

21292137
- id: ocsp-rhel-87
21302138
display_name: OS
@@ -2146,6 +2154,8 @@ axes:
21462154
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21472155
GO_DIST: "C:\\golang\\go1.22"
21482156
SKIP_ECS_AUTH_TEST: true
2157+
# CSOT tests are unreliable on our slow Windows hosts.
2158+
SKIP_CSOT_TESTS: true
21492159
- id: "ubuntu2004-64"
21502160
display_name: "Ubuntu 20.04"
21512161
run_on: ubuntu2004-test
@@ -2160,6 +2170,8 @@ axes:
21602170
SKIP_ECS_AUTH_TEST: true
21612171
SKIP_EC2_AUTH_TEST: true
21622172
SKIP_WEB_IDENTITY_AUTH_TEST: true
2173+
# CSOT tests are unreliable on our slow macOS hosts.
2174+
SKIP_CSOT_TESTS: true
21632175

21642176
- id: os-faas-80
21652177
display_name: OS

.evergreen/run-tests.sh

Lines changed: 1 addition & 0 deletions
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 15 additions & 0 deletions
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

Lines changed: 8 additions & 0 deletions
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)