Skip to content

Commit 30b32d0

Browse files
authored
PYTHON-4649 Skip CSOT tests on slow Windows and macOS hosts (mongodb#1784)
1 parent cd9de28 commit 30b32d0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.evergreen/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ functions:
435435
if [ -n "${TEST_INDEX_MANAGEMENT}" ]; then
436436
export TEST_INDEX_MANAGEMENT=1
437437
fi
438+
if [ -n "${SKIP_CSOT_TESTS}" ]; then
439+
export SKIP_CSOT_TESTS=1
440+
fi
438441
439442
GREEN_FRAMEWORK=${GREEN_FRAMEWORK} \
440443
PYTHON_BINARY=${PYTHON_BINARY} \
@@ -2072,13 +2075,17 @@ axes:
20722075
skip_EC2_auth_test: true
20732076
skip_ECS_auth_test: true
20742077
skip_web_identity_auth_test: true
2078+
# CSOT tests are unreliable on our slow macOS hosts.
2079+
SKIP_CSOT_TESTS: true
20752080
- id: macos-arm64
20762081
display_name: "macOS Arm64"
20772082
run_on: macos-14-arm64
20782083
variables:
20792084
skip_EC2_auth_test: true
20802085
skip_ECS_auth_test: true
20812086
skip_web_identity_auth_test: true
2087+
# CSOT tests are unreliable on our slow macOS hosts.
2088+
SKIP_CSOT_TESTS: true
20822089
- id: rhel7
20832090
display_name: "RHEL 7.x"
20842091
run_on: rhel79-small
@@ -2121,6 +2128,8 @@ axes:
21212128
skip_EC2_auth_test: true
21222129
skip_web_identity_auth_test: true
21232130
venv_bin_dir: "Scripts"
2131+
# CSOT tests are unreliable on our slow Windows hosts.
2132+
SKIP_CSOT_TESTS: true
21242133

21252134
# Test with authentication?
21262135
- id: auth

test/test_csot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_timeout_nested(self):
7777
@client_context.require_change_streams
7878
def test_change_stream_can_resume_after_timeouts(self):
7979
coll = self.db.test
80+
coll.insert_one({})
8081
with coll.watch() as stream:
8182
with pymongo.timeout(0.1):
8283
with self.assertRaises(PyMongoError) as ctx:

test/unified_format.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@
145145
from pymongo.typings import _Address
146146
from pymongo.write_concern import WriteConcern
147147

148+
SKIP_CSOT_TESTS = os.getenv("SKIP_CSOT_TESTS")
149+
148150
JSON_OPTS = json_util.JSONOptions(tz_aware=False)
149151

150152
IS_INTERRUPTED = False
@@ -1953,6 +1955,9 @@ def verify_outcome(self, spec):
19531955
self.assertListEqual(sorted_expected_documents, actual_documents)
19541956

19551957
def run_scenario(self, spec, uri=None):
1958+
if "csot" in self.id().lower() and SKIP_CSOT_TESTS:
1959+
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
1960+
19561961
# Kill all sessions before and after each test to prevent an open
19571962
# transaction (from a test failure) from blocking collection/database
19581963
# operations during test set up and tear down.

0 commit comments

Comments
 (0)