diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 9673acf294..31098e633e 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -299,7 +299,7 @@ functions: params: shell: "bash" working_dir: src/go.mongodb.org/mongo-driver - 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"] + 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"] script: | ${PREPARE_SHELL} bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh @@ -2005,6 +2005,8 @@ axes: GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin" GO_DIST: "C:\\golang\\go1.22" VENV_BIN_DIR: "Scripts" + # CSOT tests are unreliable on our slow Windows hosts. + SKIP_CSOT_TESTS: true - id: "rhel87-64" display_name: "RHEL 8.7" run_on: rhel8.7-large @@ -2016,6 +2018,8 @@ axes: batchtime: 1440 # Run at most once per 24 hours. variables: GO_DIST: "/opt/golang/go1.22" + # CSOT tests are unreliable on our slow macOS hosts. + SKIP_CSOT_TESTS: true # OSes that require >= 4.0 for SSL - id: os-ssl-40 @@ -2029,6 +2033,8 @@ axes: GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin" GO_DIST: "C:\\golang\\go1.22" VENV_BIN_DIR: "Scripts" + # CSOT tests are unreliable on our slow Windows hosts. + SKIP_CSOT_TESTS: true - id: "rhel87-64" display_name: "RHEL 8.7" run_on: rhel8.7-large @@ -2040,6 +2046,8 @@ axes: batchtime: 1440 # Run at most once per 24 hours. variables: GO_DIST: "/opt/golang/go1.22" + # CSOT tests are unreliable on our slow macOS hosts. + SKIP_CSOT_TESTS: true - id: ocsp-rhel-87 display_name: OS @@ -2061,6 +2069,8 @@ axes: GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin" GO_DIST: "C:\\golang\\go1.22" SKIP_ECS_AUTH_TEST: true + # CSOT tests are unreliable on our slow Windows hosts. + SKIP_CSOT_TESTS: true - id: "ubuntu2004-64" display_name: "Ubuntu 20.04" run_on: ubuntu2004-test @@ -2075,6 +2085,8 @@ axes: SKIP_ECS_AUTH_TEST: true SKIP_EC2_AUTH_TEST: true SKIP_WEB_IDENTITY_AUTH_TEST: true + # CSOT tests are unreliable on our slow macOS hosts. + SKIP_CSOT_TESTS: true - id: os-faas-80 display_name: OS diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 63d37af2a5..617b6e1d4c 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -87,6 +87,7 @@ fi AUTH=${AUTH} \ SSL=${SSL} \ +SKIP_CSOT_TESTS=${SKIP_CSOT_TESTS} \ MONGO_GO_DRIVER_CA_FILE=${MONGO_GO_DRIVER_CA_FILE} \ MONGO_GO_DRIVER_KEY_FILE=${MONGO_GO_DRIVER_KEY_FILE} \ MONGO_GO_DRIVER_PKCS8_ENCRYPTED_KEY_FILE=${MONGO_GO_DRIVER_PKCS8_ENCRYPTED_KEY_FILE} \ diff --git a/internal/integration/csot_prose_test.go b/internal/integration/csot_prose_test.go index 3923efd6e7..50c0f4e4f9 100644 --- a/internal/integration/csot_prose_test.go +++ b/internal/integration/csot_prose_test.go @@ -9,6 +9,7 @@ package integration import ( "bytes" "context" + "os" "strings" "testing" "time" @@ -25,6 +26,13 @@ import ( ) func TestCSOTProse(t *testing.T) { + // Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set + // that environment variable on Windows and macOS because the CSOT spec + // tests are unreliable on those hosts. + if os.Getenv("SKIP_CSOT_TESTS") == "true" { + t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true") + } + mt := mtest.New(t, mtest.NewOptions().CreateClient(false)) mt.RunOpts("1. multi-batch writes", mtest.NewOptions().MinServerVersion("4.4"). diff --git a/internal/integration/csot_test.go b/internal/integration/csot_test.go index 3112ba8be0..d4b54255af 100644 --- a/internal/integration/csot_test.go +++ b/internal/integration/csot_test.go @@ -9,6 +9,7 @@ package integration import ( "context" "errors" + "os" "testing" "time" @@ -26,6 +27,13 @@ import ( // Test automatic "maxTimeMS" appending and connection closing behavior. func TestCSOT_maxTimeMS(t *testing.T) { + // Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set + // that environment variable on Windows and macOS because the CSOT spec + // tests are unreliable on those hosts. + if os.Getenv("SKIP_CSOT_TESTS") == "true" { + t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true") + } + mt := mtest.New(t, mtest.NewOptions().CreateClient(false)) testCases := []struct { @@ -409,6 +417,13 @@ func TestCSOT_maxTimeMS(t *testing.T) { } func TestCSOT_errors(t *testing.T) { + // Skip CSOT tests when SKIP_CSOT_TESTS=true. In Evergreen, we typically set + // that environment variable on Windows and macOS because the CSOT spec + // tests are unreliable on those hosts. + if os.Getenv("SKIP_CSOT_TESTS") == "true" { + t.Skip("Skipping CSOT test because SKIP_CSOT_TESTS=true") + } + mt := mtest.New(t, mtest.NewOptions(). CreateClient(false). // Blocking failpoints don't work on pre-4.2 and sharded clusters. diff --git a/internal/integration/unified/unified_spec_runner.go b/internal/integration/unified/unified_spec_runner.go index 23605e8991..3066502b60 100644 --- a/internal/integration/unified/unified_spec_runner.go +++ b/internal/integration/unified/unified_spec_runner.go @@ -10,6 +10,7 @@ import ( "context" "fmt" "io/ioutil" + "os" "path" "strings" "testing" @@ -170,6 +171,13 @@ func runTestFile(t *testing.T, filepath string, expectValidFail bool, opts ...*O CreateClient(false) mt.RunOpts(testCase.Description, mtOpts, func(mt *mtest.T) { + // Skip CSOT spec tests when SKIP_CSOT_TESTS=true. In Evergreen, we + // typically set that environment variable on Windows and macOS + // because the CSOT spec tests are unreliable on those hosts. + if os.Getenv("SKIP_CSOT_TESTS") == "true" && strings.Contains(filepath, "client-side-operations-timeout") { + mt.Skip("Skipping CSOT spec test because SKIP_CSOT_TESTS=true") + } + defer func() { // catch panics from looking up elements and fail if it's unexpected if r := recover(); r != nil {