summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2018-10-22 13:01:18 -0400
committerBlake Oler <blake.oler@mongodb.com>2018-12-07 12:01:57 -0500
commit4aecec9cc78209b12ba12bdec9a22fa3daad1777 (patch)
tree2d3be9538e726ae1f31f14e1f68d5ad87eaad3ea
parent19cb92b33ae83fc8adb046232c3e5b2f53d2a564 (diff)
downloadmongo-4aecec9cc78209b12ba12bdec9a22fa3daad1777.tar.gz
SERVER-37511 Ensure sessions collection is created in replica set fixture
(cherry picked from commit 6c5d1761688ea0c8e13fe62afb3574b5326ae9e6)
-rw-r--r--buildscripts/resmokelib/testing/fixtures/replicaset.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py
index b1966e4ed59..5f5e1568e4a 100644
--- a/buildscripts/resmokelib/testing/fixtures/replicaset.py
+++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py
@@ -222,6 +222,7 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
self._await_primary()
self._await_secondaries()
self._await_stable_checkpoint()
+ self._setup_sessions_collection()
def _await_primary(self):
# Wait for the primary to be elected.
@@ -308,6 +309,11 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst
break
time.sleep(0.1) # Wait a little bit before trying again.
+ def _setup_sessions_collection(self):
+ """Set up the sessions collection so that it will not attempt to set up during a test."""
+ primary = self.nodes[0]
+ primary.mongo_client().admin.command({"refreshLogicalSessionCacheNow": 1})
+
def _do_teardown(self):
self.logger.info("Stopping all members of the replica set...")