summaryrefslogtreecommitdiff
path: root/jstests/repl/block2.js
blob: fc35b2774c4c1bcbc6505f97abdf4ce68df6de58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

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();