Skip to content

Commit

Permalink
fix(MongoMemoryReplSet): "getUri" now uses "waitUntilRunning"
Browse files Browse the repository at this point in the history
- if in state "init" "getUri" now uses "waitUntilRunning"
because when "_waitForPrimary" returns it is not ensured that the state changed
  • Loading branch information
hasezoey committed Oct 12, 2020
1 parent 0202e8f commit 18428d5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class MongoMemoryReplSet extends EventEmitter {
*/
async getUri(otherDb?: string | boolean): Promise<string> {
if (this._state === MongoMemoryReplSetStateEnum.init) {
await this._waitForPrimary();
await this.waitUntilRunning();
}
if (this._state !== MongoMemoryReplSetStateEnum.running) {
throw new Error('Replica Set is not running. Use debug for more info.');
Expand Down

0 comments on commit 18428d5

Please sign in to comment.