[SERVER-51214] Remove dead "waitForHealth" code in ReplSetTest Created: 29/Sep/20  Updated: 27/Oct/23  Resolved: 29/Sep/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Backlog - Replication Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

'waitForHealth' is an optional parameter to a few ReplSetTest methods, but it always defaults to false, and I don't see any tests using it:

$ git grep waitForHealth
src/mongo/shell/replsettest.js:    function _waitForHealth(node, state, timeout) {
src/mongo/shell/replsettest.js:     * @param {boolean} [waitForHealth] If true, wait for the health indicator of the replica set
src/mongo/shell/replsettest.js:    this._waitForInitialConnection = function(n, waitForHealth) {
src/mongo/shell/replsettest.js:        waitForHealth = waitForHealth || false;
src/mongo/shell/replsettest.js:        if (waitForHealth) {
src/mongo/shell/replsettest.js:            _waitForHealth(this.nodes[n], Health.UP);
src/mongo/shell/replsettest.js:     * @param {boolean} [waitForHealth] If true, wait for the health indicator of the replica set
src/mongo/shell/replsettest.js:        n, options, restart, waitForHealth) {
src/mongo/shell/replsettest.js:        return this._waitForInitialConnection(n, waitForHealth);

If it's dead code, it would be good to remove it.



 Comments   
Comment by Esha Maharishi (Inactive) [ 29/Sep/20 ]

Ah, actually, tests might be passing "true" without a "/* waitForHealth */" comment.

It seems like there's exactly one test that uses it (the last one here):

$ git grep "start(.*,.*,.*,.*true" jstests/
jstests/noPassthrough/standalone_replication_recovery.js:node = rst.start(node, {noReplSet: true, setParameter: {logComponentVerbosity: logLevel}}, true);
jstests/sharding/shard_identity_rollback.js:priConn = replTest.start(priConn.nodeId, {shardsvr: '', waitForConnect: true}, true);
jstests/sslSpecial/x509_cluster_auth_rollover.js:        const newNode = rst.start(nodeId, {}, true, true);

Going ahead and closing.

Generated at Thu Feb 08 05:24:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.