Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-3313 Skip CSOT spec tests on Windows and macOS. #1818

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,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
Expand Down Expand Up @@ -2090,6 +2090,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
Expand All @@ -2101,6 +2103,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
Expand All @@ -2114,6 +2118,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
Expand All @@ -2125,6 +2131,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
Expand All @@ -2146,6 +2154,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
Expand All @@ -2160,6 +2170,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
Expand Down
1 change: 1 addition & 0 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
8 changes: 8 additions & 0 deletions mongo/integration/csot_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package integration

import (
"context"
"os"
"strings"
"testing"
"time"
Expand All @@ -22,6 +23,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").
Expand Down
15 changes: 15 additions & 0 deletions mongo/integration/csot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package integration
import (
"context"
"errors"
"os"
"testing"
"time"

Expand All @@ -27,6 +28,13 @@ import (
// Test automatic "maxTimeMS" appending and connection closing behavior when
// CSOT is disabled and enabled.
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 {
Expand Down Expand Up @@ -586,6 +594,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.
Expand Down
8 changes: 8 additions & 0 deletions mongo/integration/unified/unified_spec_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"context"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"testing"
Expand Down Expand Up @@ -150,6 +151,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 {
Expand Down
Loading