SERVER-117088 Increase pymongo timeouts on asan variants (#46306)
GitOrigin-RevId: 3400fa6aead18edcdb42185ad2284af6ca0dc94e
This commit is contained in:
committed by
MongoDB Bot
parent
d3bba2cfb3
commit
7e3e035146
@@ -9,7 +9,7 @@ import time
|
||||
|
||||
from pymongo.errors import OperationFailure
|
||||
|
||||
from buildscripts.resmokelib import errors
|
||||
from buildscripts.resmokelib import config, errors
|
||||
from buildscripts.resmokelib.generate_fuzz_config.mongo_fuzzer_configs import (
|
||||
generate_normal_mongo_parameters,
|
||||
)
|
||||
@@ -28,6 +28,13 @@ def validate_runtime_parameter_spec(spec):
|
||||
)
|
||||
|
||||
|
||||
def build_client(node, auth_options):
|
||||
"""Build a pymongo MongoClient for the given node with the given auth options."""
|
||||
if config.IS_ASAN:
|
||||
return fixture_interface.build_client(node, auth_options, timeout_millis=120000)
|
||||
return fixture_interface.build_client(node, auth_options)
|
||||
|
||||
|
||||
class RuntimeParametersState:
|
||||
"""Encapsulates the runtime-state of a set of parameters we are fuzzing. Tracks the last time we set a parameter value and holds
|
||||
the logic for generating new values."""
|
||||
@@ -226,7 +233,7 @@ class FuzzRuntimeParameters(interface.Hook):
|
||||
|
||||
def _invoke_get_parameter_and_log(self, node):
|
||||
"""Helper to print the current state of a node's runtime-fuzzable parameters. Only usable once before_suite has initialized the runtime state of the parameters."""
|
||||
client = fixture_interface.build_client(node, self._auth_options)
|
||||
client = build_client(node, self._auth_options)
|
||||
params_to_get = (
|
||||
self._mongos_param_state.get_spec()
|
||||
if client.is_mongos
|
||||
@@ -241,7 +248,7 @@ class FuzzRuntimeParameters(interface.Hook):
|
||||
|
||||
def _invoke_get_cluster_parameter_and_log(self, node):
|
||||
"""Helper to print the current state of a cluster's fuzzable cluster parameters. Only usable once before_suite has initialized the runtime state of the parameters."""
|
||||
client = fixture_interface.build_client(node, self._auth_options)
|
||||
client = build_client(node, self._auth_options)
|
||||
params_to_get = self._cluster_param_state.get_keys()
|
||||
get_result = client.admin.command("getClusterParameter", params_to_get)
|
||||
self.logger.info(
|
||||
@@ -404,9 +411,7 @@ class _SetParameterThread(threading.Thread):
|
||||
mongod_params_to_set,
|
||||
)
|
||||
for node in repl_set.nodes:
|
||||
invoke_set_parameter(
|
||||
fixture_interface.build_client(node, self._auth_options), mongod_params_to_set
|
||||
)
|
||||
invoke_set_parameter(build_client(node, self._auth_options), mongod_params_to_set)
|
||||
|
||||
for standalone in self._standalone_fixtures:
|
||||
self.logger.info(
|
||||
@@ -414,9 +419,7 @@ class _SetParameterThread(threading.Thread):
|
||||
standalone.port,
|
||||
mongod_params_to_set,
|
||||
)
|
||||
invoke_set_parameter(
|
||||
fixture_interface.build_client(standalone, self._auth_options), mongod_params_to_set
|
||||
)
|
||||
invoke_set_parameter(build_client(standalone, self._auth_options), mongod_params_to_set)
|
||||
|
||||
for mongos in self._mongos_fixtures:
|
||||
self.logger.info(
|
||||
@@ -424,9 +427,7 @@ class _SetParameterThread(threading.Thread):
|
||||
mongos.port,
|
||||
mongos_params_to_set,
|
||||
)
|
||||
invoke_set_parameter(
|
||||
fixture_interface.build_client(mongos, self._auth_options), mongos_params_to_set
|
||||
)
|
||||
invoke_set_parameter(build_client(mongos, self._auth_options), mongos_params_to_set)
|
||||
|
||||
if self._mongos_fixtures:
|
||||
self.logger.info(
|
||||
@@ -434,6 +435,6 @@ class _SetParameterThread(threading.Thread):
|
||||
cluster_params_to_set,
|
||||
)
|
||||
invoke_set_cluster_parameter(
|
||||
fixture_interface.build_client(self._mongos_fixtures[0], self._auth_options),
|
||||
build_client(self._mongos_fixtures[0], self._auth_options),
|
||||
cluster_params_to_set,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user