summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/fixtures/replicaset.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/resmokelib/testing/fixtures/replicaset.py')
-rw-r--r--buildscripts/resmokelib/testing/fixtures/replicaset.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py
index 0c599800c2d..e5bd42521ee 100644
--- a/buildscripts/resmokelib/testing/fixtures/replicaset.py
+++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py
@@ -28,7 +28,8 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
num_nodes=2, start_initial_sync_node=False, write_concern_majority_journal_default=None,
auth_options=None, replset_config_options=None, voting_secondaries=True,
all_nodes_electable=False, use_replica_set_connection_string=None, linear_chain=False,
- mixed_bin_versions=None, default_read_concern=None, default_write_concern=None):
+ mixed_bin_versions=None, default_read_concern=None, default_write_concern=None,
+ shard_logging_prefix=None):
"""Initialize ReplicaSetFixture."""
interface.ReplFixture.__init__(self, logger, job_num, dbpath_prefix=dbpath_prefix)
@@ -47,6 +48,7 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
self.mixed_bin_versions = utils.default_if_none(mixed_bin_versions,
config.MIXED_BIN_VERSIONS)
self.mixed_bin_versions_config = self.mixed_bin_versions
+ self.shard_logging_prefix = shard_logging_prefix
# Use the values given from the command line if they exist for linear_chain and num_nodes.
linear_chain_option = utils.default_if_none(config.LINEAR_CHAIN, linear_chain)
@@ -548,6 +550,11 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
suffix = str(index - 1) if self.num_nodes > 2 else ""
node_name = "secondary{}".format(suffix)
+ if self.shard_logging_prefix is not None:
+ node_name = f"{self.shard_logging_prefix}:{node_name}"
+ return logging.loggers.new_fixture_node_logger("ShardedClusterFixture", self.job_num,
+ node_name)
+
return logging.loggers.new_fixture_node_logger(self.__class__.__name__, self.job_num,
node_name)