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-16 13:51:47 -0400 |
commit | 6a8fb8cd6468735dfeedfd61d1c48299f3732bb9 (patch) | |
tree | 2a6a75d18d6a0d263bd0e2ff87df140eb2855cbd /buildscripts | |
parent | 93db19e8a0489fa15aa2d0b68548342b476caf7e (diff) | |
download | mongo-6a8fb8cd6468735dfeedfd61d1c48299f3732bb9.tar.gz |
SERVER-29433 Improve logging during ReplicaSetFixture initialization
(cherry picked from commit 47aad7d695eb2f01696a706a70dc1012e8247d46)
Diffstat (limited to 'buildscripts')
-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 ac65f037853..1498652acec 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py @@ -192,11 +192,12 @@ 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) def _await_secondaries(self): # Wait for the secondaries to become available. @@ -208,12 +209,13 @@ class ReplicaSetFixture(interface.ReplFixture): 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() |