diff options
author | Spencer T Brody <spencer@mongodb.com> | 2017-06-02 14:49:50 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2017-06-15 16:54:01 -0400 |
commit | aacfc466c5ed23f4ea2808398256913864a90ec5 (patch) | |
tree | ca89f3619139bfb235799807ffa0121cf1be7799 | |
parent | 6ad1c52b68afff7c3698f3df143f10d2f747be06 (diff) | |
download | mongo-aacfc466c5ed23f4ea2808398256913864a90ec5.tar.gz |
SERVER-29433 Improve logging during ReplicaSetFixture initialization
(cherry picked from commit 47aad7d695eb2f01696a706a70dc1012e8247d46)
-rw-r--r-- | buildscripts/resmokelib/testing/fixtures/replicaset.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py index c1d6521d5e9..3ac4b870678 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py @@ -104,23 +104,25 @@ class ReplicaSetFixture(interface.ReplFixture): # Wait for the primary to be elected. client = utils.new_mongo_client(port=self.port) while True: + self.logger.info("Waiting for primary on port %d to be elected.", self.port) is_master = client.admin.command("isMaster")["ismaster"] if is_master: break - self.logger.info("Waiting for primary on port %d to be elected.", self.port) time.sleep(0.1) # Wait a little bit before trying again. + self.logger.info("Primary on port %d successfully elected.", self.port) # Wait for the secondaries to become available. for secondary in self.get_secondaries(): client = utils.new_mongo_client(port=secondary.port, read_preference=pymongo.ReadPreference.SECONDARY) while True: + self.logger.info("Waiting for secondary on port %d to become available.", + secondary.port) is_secondary = client.admin.command("isMaster")["secondary"] if is_secondary: break - self.logger.info("Waiting for secondary on port %d to become available.", - secondary.port) time.sleep(0.1) # Wait a little bit before trying again. + self.logger.info("Secondary on port %d is now available.", secondary.port) def teardown(self): running_at_start = self.is_running() |