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-02 15:55:04 -0400 |
commit | 47aad7d695eb2f01696a706a70dc1012e8247d46 (patch) | |
tree | 33391046d21542ff507bac8b8885a2d4fd321c58 | |
parent | 20e9320f7716515d68c27324dc20080d585fd70f (diff) | |
download | mongo-47aad7d695eb2f01696a706a70dc1012e8247d46.tar.gz |
SERVER-29433 Improve logging during ReplicaSetFixture initialization
-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 1c7e4157cad..faf26b50cb3 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py @@ -186,11 +186,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. @@ -202,12 +203,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 _do_teardown(self): running_at_start = self.is_running() |