0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-25 09:19:32 +01:00
mongodb/jstests/noPassthrough/restart_node_with_bridge.js
Kyle Suarez b377d97f8b SERVER-34622 use existing options in _unbridgedNodes if bridge is enabled
Otherwise, restarting a node will not use the correct options for when
the node was originally brought up.
2018-04-24 13:36:37 -04:00

24 lines
691 B
JavaScript

/**
* Tests that a node can be successfully restarted when the bridge is enabled.
* @tags: [requires_persistence, requires_replication]
*/
(function() {
"use strict";
const name = "restart_node_with_bridge";
const rst = new ReplSetTest({name: name, nodes: 1, useBridge: true});
rst.startSet();
rst.initiate();
rst.awaitNodesAgreeOnPrimary();
let primary = rst.getPrimary();
assert.commandWorked(primary.getDB("test").getCollection(name).insert({_id: 1}));
rst.restart(primary);
rst.awaitNodesAgreeOnPrimary();
primary = rst.getPrimary();
assert.eq(primary.getDB("test").getCollection(name).count({_id: 1}), 1);
rst.stopSet();
}());