Skip to content

PYTHON-5005 Skip more csot tests where applicable #2029

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

Merged
merged 1 commit into from
Dec 4, 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
5 changes: 5 additions & 0 deletions test/asynchronous/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import copy
import gc
import itertools
import os
import random
import re
import sys
Expand Down Expand Up @@ -1412,6 +1413,8 @@ async def test_to_list_length(self):
self.assertEqual(len(docs), 2)

async def test_to_list_csot_applied(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
client = await self.async_single_client(timeoutMS=500, w=1)
coll = client.pymongo.test
# Initialize the client with a larger timeout to help make test less flakey
Expand Down Expand Up @@ -1453,6 +1456,8 @@ async def test_command_cursor_to_list_length(self):

@async_client_context.require_failCommand_blockConnection
async def test_command_cursor_to_list_csot_applied(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
client = await self.async_single_client(timeoutMS=500, w=1)
coll = client.pymongo.test
# Initialize the client with a larger timeout to help make test less flakey
Expand Down
4 changes: 4 additions & 0 deletions test/test_csot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class TestCSOT(IntegrationTest):
RUN_ON_LOAD_BALANCER = True

def test_timeout_nested(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
coll = self.db.coll
self.assertEqual(_csot.get_timeout(), None)
self.assertEqual(_csot.get_deadline(), float("inf"))
Expand Down Expand Up @@ -76,6 +78,8 @@ def test_timeout_nested(self):

@client_context.require_change_streams
def test_change_stream_can_resume_after_timeouts(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
coll = self.db.test
coll.insert_one({})
with coll.watch() as stream:
Expand Down
5 changes: 5 additions & 0 deletions test/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import copy
import gc
import itertools
import os
import random
import re
import sys
Expand Down Expand Up @@ -1403,6 +1404,8 @@ def test_to_list_length(self):
self.assertEqual(len(docs), 2)

def test_to_list_csot_applied(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
client = self.single_client(timeoutMS=500, w=1)
coll = client.pymongo.test
# Initialize the client with a larger timeout to help make test less flakey
Expand Down Expand Up @@ -1444,6 +1447,8 @@ def test_command_cursor_to_list_length(self):

@client_context.require_failCommand_blockConnection
def test_command_cursor_to_list_csot_applied(self):
if os.environ.get("SKIP_CSOT_TESTS", ""):
raise unittest.SkipTest("SKIP_CSOT_TESTS is set, skipping...")
client = self.single_client(timeoutMS=500, w=1)
coll = client.pymongo.test
# Initialize the client with a larger timeout to help make test less flakey
Expand Down
Loading