0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00
mongodb/jstests/replsets/server_status_repl.js

17 lines
481 B
JavaScript
Raw Normal View History

var rt = new ReplSetTest({name: "server_status_repl", nodes: 2});
2015-08-20 15:04:51 +02:00
rt.startSet();
rt.initiate();
rt.awaitSecondaryNodes();
var secondary = rt.getSecondary();
var primary = rt.getPrimary();
var testDB = primary.getDB("test");
assert.commandWorked(testDB.createCollection('a'));
assert.commandWorked(testDB.b.insert({}, {writeConcern: {w: 2}}));
2015-08-20 15:04:51 +02:00
var ss = primary.getDB("test").serverStatus({repl: 1});
2015-08-20 15:04:51 +02:00
assert.neq(ss.repl.replicationProgress, null, tojson(ss.repl));
rt.stopSet();