Skip to content

Commit 9065639

Browse files
committed
more cleanup
1 parent 9d8759e commit 9065639

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

test/asynchronous/test_retryable_writes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import pprint
2121
import sys
2222
import threading
23-
from test.asynchronous.utils import async_set_fail_point
23+
from test.asynchronous.utils import async_set_fail_point, flaky
2424

2525
sys.path[0:0] = [""]
2626

@@ -497,6 +497,7 @@ class TestPoolPausedError(AsyncIntegrationTest):
497497
@async_client_context.require_failCommand_blockConnection
498498
@async_client_context.require_retryable_writes
499499
@client_knobs(heartbeat_frequency=0.05, min_heartbeat_interval=0.05)
500+
@flaky # PYTHON-5291
500501
async def test_pool_paused_error_is_retryable(self):
501502
cmap_listener = CMAPListener()
502503
cmd_listener = OvertCommandListener()

test/asynchronous/unified_format.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,16 @@ def maybe_skip_test(self, spec):
533533
class_name = self.__class__.__name__.lower()
534534
description = spec["description"].lower()
535535
if "csot" in class_name:
536-
if sys.platform == "win32":
537-
self.skipTest("PYTHON-3522 CSOT tests run too slow on Windows")
536+
# Skip tests that are too slow to run on a given platform.
537+
slow_win32 = [
538+
"maxtimems value in the command is less than timeoutms",
539+
"non-tailable cursor lifetime remaining timeoutms applied to getmore if timeoutmode is unset",
540+
]
538541
slow_macos = [
539542
"non-tailable cursor lifetime remaining timeoutms applied to getmore if timeoutmode is unset"
540543
]
544+
if sys.platform == "win32" and description in slow_win32 or "gridfs" in class_name:
545+
self.skipTest("PYTHON-3522 CSOT test runs too slow on Windows")
541546
if sys.platform == "darwin" and description in slow_macos:
542547
self.skipTest("PYTHON-3522 CSOT test runs too slow on MacOS")
543548
if async_client_context.storage_engine == "mmapv1":
@@ -1378,7 +1383,7 @@ async def run_scenario(self, spec, uri=None):
13781383
# Handle flaky tests.
13791384
flaky_tests = [
13801385
# PYTHON-5170
1381-
".*test_discovery_and_monitoring.TestUnifiedInterruptInUsePoolClear.*",
1386+
".*test_discovery_and_monitoring.*",
13821387
# PYTHON-5174
13831388
".*Driver_extends_timeout_while_streaming",
13841389
# PYTHON-5315
@@ -1394,7 +1399,7 @@ async def run_scenario(self, spec, uri=None):
13941399
if re.match(flaky_test, self.id()) is not None:
13951400
func_name = self.id()
13961401
options = dict(reset_func=self.asyncSetUp, func_name=func_name)
1397-
if "csot" in func_name:
1402+
if "csot" in func_name.lower():
13981403
options["max_runs"] = 3
13991404
options["affects_cpython_linux"] = True
14001405
decorator = flaky(**options)

test/test_retryable_writes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import pprint
2121
import sys
2222
import threading
23-
from test.utils import set_fail_point
23+
from test.utils import flaky, set_fail_point
2424

2525
sys.path[0:0] = [""]
2626

@@ -495,6 +495,7 @@ class TestPoolPausedError(IntegrationTest):
495495
@client_context.require_failCommand_blockConnection
496496
@client_context.require_retryable_writes
497497
@client_knobs(heartbeat_frequency=0.05, min_heartbeat_interval=0.05)
498+
@flaky # PYTHON-5291
498499
def test_pool_paused_error_is_retryable(self):
499500
cmap_listener = CMAPListener()
500501
cmd_listener = OvertCommandListener()

test/unified_format.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,16 @@ def maybe_skip_test(self, spec):
532532
class_name = self.__class__.__name__.lower()
533533
description = spec["description"].lower()
534534
if "csot" in class_name:
535-
if sys.platform == "win32":
536-
self.skipTest("PYTHON-3522 CSOT tests run too slow on Windows")
535+
# Skip tests that are too slow to run on a given platform.
536+
slow_win32 = [
537+
"maxtimems value in the command is less than timeoutms",
538+
"non-tailable cursor lifetime remaining timeoutms applied to getmore if timeoutmode is unset",
539+
]
537540
slow_macos = [
538541
"non-tailable cursor lifetime remaining timeoutms applied to getmore if timeoutmode is unset"
539542
]
543+
if sys.platform == "win32" and description in slow_win32 or "gridfs" in class_name:
544+
self.skipTest("PYTHON-3522 CSOT test runs too slow on Windows")
540545
if sys.platform == "darwin" and description in slow_macos:
541546
self.skipTest("PYTHON-3522 CSOT test runs too slow on MacOS")
542547
if client_context.storage_engine == "mmapv1":
@@ -1365,7 +1370,7 @@ def run_scenario(self, spec, uri=None):
13651370
# Handle flaky tests.
13661371
flaky_tests = [
13671372
# PYTHON-5170
1368-
".*test_discovery_and_monitoring.TestUnifiedInterruptInUsePoolClear.*",
1373+
".*test_discovery_and_monitoring.*",
13691374
# PYTHON-5174
13701375
".*Driver_extends_timeout_while_streaming",
13711376
# PYTHON-5315
@@ -1381,7 +1386,7 @@ def run_scenario(self, spec, uri=None):
13811386
if re.match(flaky_test, self.id()) is not None:
13821387
func_name = self.id()
13831388
options = dict(reset_func=self.setUp, func_name=func_name)
1384-
if "csot" in func_name:
1389+
if "csot" in func_name.lower():
13851390
options["max_runs"] = 3
13861391
options["affects_cpython_linux"] = True
13871392
decorator = flaky(**options)

0 commit comments

Comments
 (0)