mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-24 16:46:00 +01:00
SERVER-96622 fix ValidateCollections with ExternalFixture (#28848)
GitOrigin-RevId: ad875530c1884deb44c617f378aae4447aea89dd
This commit is contained in:
parent
7d32e888ed
commit
40ee074685
@ -32,3 +32,6 @@ class ExternalFixture(interface.Fixture):
|
||||
def get_driver_connection_url(self):
|
||||
"""Return the driver connection URL."""
|
||||
return self.shell_conn_string
|
||||
|
||||
def _all_mongo_d_s_t(self):
|
||||
return [self]
|
||||
|
@ -11,7 +11,8 @@ import pymongo.mongo_client
|
||||
from pymongo.collection import Collection
|
||||
from pymongo.database import Database
|
||||
|
||||
from buildscripts.resmokelib.testing.fixtures.interface import MultiClusterFixture, build_client
|
||||
from buildscripts.resmokelib.testing.fixtures.external import ExternalFixture
|
||||
from buildscripts.resmokelib.testing.fixtures.interface import build_client
|
||||
from buildscripts.resmokelib.testing.fixtures.standalone import MongoDFixture
|
||||
from buildscripts.resmokelib.testing.hooks import jsfile
|
||||
|
||||
@ -87,12 +88,14 @@ class ValidateCollectionsTestCase(jsfile.DynamicJSTestCase):
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=os.cpu_count()) as executor:
|
||||
futures = []
|
||||
for node in self.fixture._all_mongo_d_s_t():
|
||||
if not isinstance(node, MongoDFixture):
|
||||
if not isinstance(node, MongoDFixture) and not isinstance(
|
||||
node, ExternalFixture
|
||||
):
|
||||
continue
|
||||
|
||||
if not validate_node(node, self.shell_options, self.logger, executor, futures):
|
||||
raise RuntimeError(
|
||||
f"Internal error while trying to validate node: {node.get_internal_connection_string()}"
|
||||
f"Internal error while trying to validate node: {node.get_driver_connection_url()}"
|
||||
)
|
||||
|
||||
if not all(
|
||||
@ -152,7 +155,7 @@ def validate_node(
|
||||
return True
|
||||
except:
|
||||
logger.exception(
|
||||
f"Unknown exception while validating node {node.get_internal_connection_string()}"
|
||||
f"Unknown exception while validating node {node.get_driver_connection_url()}"
|
||||
)
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user