diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2015-10-15 10:58:53 -0400 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2015-10-15 10:58:53 -0400 |
commit | 06fcd7530230075f1b4afffa2164911913c59538 (patch) | |
tree | 49686836f6fc11e9c112599b7ac23763ec8f3ae1 /buildscripts | |
parent | 51cb08c05e9fa199562e32f30bd1e627639740c6 (diff) | |
download | mongo-06fcd7530230075f1b4afffa2164911913c59538.tar.gz |
SERVER-20899 Fix issue with resmoke.py fixtures and CleanEveryN hook.
Avoid constructing new Fixture instances inside
ReplicaSetFixture.setup() and ShardedClusterFixture.setup().
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/resmokelib/testing/fixtures/replicaset.py | 9 | ||||
-rw-r--r-- | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | 16 |
2 files changed, 17 insertions, 8 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py index a966a3176ec..e673c0bbb0a 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py @@ -60,10 +60,13 @@ class ReplicaSetFixture(interface.ReplFixture): def setup(self): self.replset_name = self.mongod_options.get("replSet", "rs") - for i in xrange(self.num_nodes): - node = self._new_mongod(i, self.replset_name) + if not self.nodes: + for i in xrange(self.num_nodes): + node = self._new_mongod(i, self.replset_name) + self.nodes.append(node) + + for node in self.nodes: node.setup() - self.nodes.append(node) self.port = self.get_primary().port diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py index 4b3d61949a1..8d1c1b74c41 100644 --- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py +++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py @@ -74,14 +74,18 @@ class ShardedClusterFixture(interface.Fixture): def setup(self): if self.separate_configsvr: - self.configsvr = self._new_configsvr() + if self.configsvr is None: + self.configsvr = self._new_configsvr() self.configsvr.setup() + if not self.shards: + for i in xrange(self.num_shards): + shard = self._new_shard(i) + self.shards.append(shard) + # Start up each of the shards - for i in xrange(self.num_shards): - shard = self._new_shard(i) + for shard in self.shards: shard.setup() - self.shards.append(shard) def await_ready(self): # Wait for the config server @@ -92,8 +96,10 @@ class ShardedClusterFixture(interface.Fixture): for shard in self.shards: shard.await_ready() + if self.mongos is None: + self.mongos = self._new_mongos() + # Start up the mongos - self.mongos = self._new_mongos() self.mongos.setup() # Wait for the mongos |