|
There are two different functions used to allocate ports in jstests:
https://github.com/mongodb/mongo/blob/r2.6.0-rc0/src/mongo/shell/servers.js#L218
https://github.com/mongodb/mongo/blob/r2.6.0-rc0/src/mongo/shell/servers_misc.js#L236
One of them actually keeps track of what ports have been used and allocates the next one, but the other does not and just allocates a block that you request without any checks.
The "ReplSetTest" helper uses the one that does not do any checks, which means that two "ReplSetTest" helpers cannot be used simultaneously without allocating and setting ports manually. The other helpers don't have this problem (except for ShardingTest which uses a ReplSetTest object when the shards are replica sets).
|