0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

ensure that the correct member is primary in test

This commit is contained in:
Kristina 2011-07-28 14:18:19 -04:00
parent 8ac0b95fee
commit d676de2512

View File

@ -48,7 +48,7 @@ var admin = p.getDB("admin");
var foo = p.getDB("foo");
var local = p.getDB("local");
var config = {_id : basename, members : [{_id : 0, host : hostname+":"+ports[0]}]};
var config = {_id : basename, members : [{_id : 0, host : hostname+":"+ports[0], priority:2}]};
printjson(config);
var result = admin.runCommand({replSetInitiate : config});
print("result:");
@ -126,6 +126,10 @@ var startSlave = function(n) {
assert.eq(status.members[n].state, 2);
assert.soon(function() {
return admin.runCommand({isMaster : 1}).ismaster;
});
admin.foo.insert({x:1});
assert.soon(function() {
var last = local.oplog.rs.find().sort({$natural:-1}).limit(1).next();