The ReplicaSetFixture in resmoke.py configures the replica set such that the first node is always the primary by making all other nodes have a priority of zero. In order to meaningfully support failovers, the ReplicaSetFixture class should be changed to have an option where all nodes are electable.
- An all_nodes_electable parameter should be added to the ReplicaSetFixture constructor. The parameter should default to false in order to avoid needing to change any existing usages of the ReplicaSetFixture class by other test suites.
- Change JSTestCase#configure() and JSONSchemaTestCase#configure() to use a MongoDB connection URI rather than using the ReplicaSetFixture#port attribute and the --port option to the mongo shell. Note: This behavior may be implemented under
- Update ReplicaSetFixture#get_primary() to take an optional timeout parameter. The implementation should be changed to do a round of "isMaster" requests and wait until a primary becomes available or the specified period has expired. A ServerFailure exception should be raised if none of the nodes report being the primary.
- Update ReplicaSetFixture#setup() to explicitly use ReplicaSetFixture#nodes since the first node is initiated in a replica set by itself so the other nodes are able to transition to the SECONDARY state more quickly.