Skip to content
Open
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
19 changes: 18 additions & 1 deletion test/asynchronous/test_connection_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

import asyncio
import os
import re
import sys
import time
from pathlib import Path

from test.asynchronous.utils import async_get_pool, async_get_pools
from test.asynchronous.utils import async_get_pool, async_get_pools, flaky

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

Expand Down Expand Up @@ -216,6 +217,22 @@ async def set_fail_point(self, command_args):
await self.configure_fail_point(self.client, command_args)

async def run_scenario(self, scenario_def, test):
# Handle flaky tests.
flaky_tests = [
("PYTHON-6055", ".*pool_checkout_custom_maxConnecting_is_enforced.*"),
("PYTHON-6055", ".*pool_checkout_maxConnecting_is_enforced.*"),
("PYTHON-6055", ".*pool_checkout_maxConnecting_timeout.*"),
("PYTHON-6055", ".*pool_checkout_minPoolSize_connection_maxConnecting.*"),
("PYTHON-6055", ".*pool_checkout_returned_connection_maxConnecting.*"),
]
for reason, flaky_test in flaky_tests:
if re.match(flaky_test.lower(), self.id().lower()) is not None:
decorator = flaky(reason=reason, func_name=self.id(), affects_cpython_linux=True)
await decorator(self._run_scenario)(scenario_def, test)
return
Comment on lines +228 to +232

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be resolved by #3006.

await self._run_scenario(scenario_def, test)

async def _run_scenario(self, scenario_def, test):
"""Run a CMAP spec test."""
self.logs: list = []
self.assertEqual(scenario_def["version"], 1)
Expand Down
19 changes: 18 additions & 1 deletion test/test_connection_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

import asyncio
import os
import re
import sys
import time
from pathlib import Path

from test.utils import get_pool, get_pools
from test.utils import flaky, get_pool, get_pools

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

Expand Down Expand Up @@ -216,6 +217,22 @@ def set_fail_point(self, command_args):
self.configure_fail_point(self.client, command_args)

def run_scenario(self, scenario_def, test):
# Handle flaky tests.
flaky_tests = [
("PYTHON-6055", ".*pool_checkout_custom_maxConnecting_is_enforced.*"),
("PYTHON-6055", ".*pool_checkout_maxConnecting_is_enforced.*"),
("PYTHON-6055", ".*pool_checkout_maxConnecting_timeout.*"),
("PYTHON-6055", ".*pool_checkout_minPoolSize_connection_maxConnecting.*"),
("PYTHON-6055", ".*pool_checkout_returned_connection_maxConnecting.*"),
]
for reason, flaky_test in flaky_tests:
if re.match(flaky_test.lower(), self.id().lower()) is not None:
decorator = flaky(reason=reason, func_name=self.id(), affects_cpython_linux=True)
decorator(self._run_scenario)(scenario_def, test)
return
Comment thread
NoahStapp marked this conversation as resolved.
self._run_scenario(scenario_def, test)

def _run_scenario(self, scenario_def, test):
"""Run a CMAP spec test."""
self.logs: list = []
self.assertEqual(scenario_def["version"], 1)
Expand Down
Loading