PYTHON-4649 Skip CSOT tests on slow Windows and macOS hosts (#1784)

This commit is contained in:
Shane Harvey 2024-08-12 10:10:19 -07:00 committed by GitHub
parent cd9de28c8f
commit 30b32d00c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 0 deletions

View File

@ -435,6 +435,9 @@ functions:
if [ -n "${TEST_INDEX_MANAGEMENT}" ]; then
export TEST_INDEX_MANAGEMENT=1
fi
if [ -n "${SKIP_CSOT_TESTS}" ]; then
export SKIP_CSOT_TESTS=1
fi
GREEN_FRAMEWORK=${GREEN_FRAMEWORK} \
PYTHON_BINARY=${PYTHON_BINARY} \
@ -2072,6 +2075,8 @@ axes:
skip_EC2_auth_test: true
skip_ECS_auth_test: true
skip_web_identity_auth_test: true
# CSOT tests are unreliable on our slow macOS hosts.
SKIP_CSOT_TESTS: true
- id: macos-arm64
display_name: "macOS Arm64"
run_on: macos-14-arm64
@ -2079,6 +2084,8 @@ axes:
skip_EC2_auth_test: true
skip_ECS_auth_test: true
skip_web_identity_auth_test: true
# CSOT tests are unreliable on our slow macOS hosts.
SKIP_CSOT_TESTS: true
- id: rhel7
display_name: "RHEL 7.x"
run_on: rhel79-small
@ -2121,6 +2128,8 @@ axes:
skip_EC2_auth_test: true
skip_web_identity_auth_test: true
venv_bin_dir: "Scripts"
# CSOT tests are unreliable on our slow Windows hosts.
SKIP_CSOT_TESTS: true
# Test with authentication?
- id: auth

View File

@ -77,6 +77,7 @@ class TestCSOT(IntegrationTest):
@client_context.require_change_streams
def test_change_stream_can_resume_after_timeouts(self):
coll = self.db.test
coll.insert_one({})
with coll.watch() as stream:
with pymongo.timeout(0.1):
with self.assertRaises(PyMongoError) as ctx:

View File

@ -145,6 +145,8 @@ from pymongo.topology_description import TopologyDescription
from pymongo.typings import _Address
from pymongo.write_concern import WriteConcern
SKIP_CSOT_TESTS = os.getenv("SKIP_CSOT_TESTS")
JSON_OPTS = json_util.JSONOptions(tz_aware=False)
IS_INTERRUPTED = False
@ -1953,6 +1955,9 @@ class UnifiedSpecTestMixinV1(IntegrationTest):
self.assertListEqual(sorted_expected_documents, actual_documents)
def run_scenario(self, spec, uri=None):
if "csot" in self.id().lower() and SKIP_CSOT_TESTS:
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
# Kill all sessions before and after each test to prevent an open
# transaction (from a test failure) from blocking collection/database
# operations during test set up and tear down.