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

32 lines
603 B
JavaScript

var rt = new ReplTest( "block1" );
m = rt.start( true );
s = rt.start( false );
function setup(){
dbm = m.getDB( "foo" );
dbs = s.getDB( "foo" );
tm = dbm.bar;
ts = dbs.bar;
}
setup();
function check( msg ){
assert.eq( tm.count() , ts.count() , "check: " + msg );
}
check( "A" );
assert.writeOK(tm.insert({ x: 1 }, { writeConcern: { w: 2 }}));
assert.writeOK(tm.insert({ x: 2 }, { writeConcern: { w: 2, wtimeout: 3000 }}));
rt.stop( false );
assert.writeError(tm.insert({ x: 3 }, { writeConcern: { w: 2, wtimeout: 3000 }}));
assert.eq( 3 , tm.count() , "D1" );
rt.stop();