summaryrefslogtreecommitdiff
path: root/jstests/replsets/server_status_repl.js
blob: c00fcc8818a15e1044ed25fdce5d5f9995e944ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var rt = new ReplSetTest({name: "server_status_repl", nodes: 2});
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.writeOK(testDB.b.insert({}, {writeConcern: {w: 2}}));

var ss = primary.getDB("test").serverStatus({repl: 1});
assert.neq(ss.repl.replicationProgress, null, tojson(ss.repl));

rt.stopSet();