summaryrefslogtreecommitdiff
path: root/jstests/gle/core/gle_shell_server5441.js
blob: dedb135f20a3328b8f2ad51502eb6fb852c30961 (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

// Call the defaultPrompt function once at the beginning of the test to cache the
// build info. The first invocation of the function would otherwise overwrite the
// getLastError result.
defaultPrompt();

t = db.server5441;
t.drop();

function checkgle(iteration) {
    var gle = db.getLastErrorObj();
    assert.eq(2, gle.n, "failed on iteration " + iteration + ", getLastErrorObj()=" + tojson(gle));
}

t.insert( { x : 1 } );
t.insert( { x : 1 } );
updateReturn = t.update( {} , { $inc : { x : 2 } } , false , true );

for ( i=0; i<100; i++ ) {
    checkgle(""+i);
}

db.adminCommand( { replSetGetStatus : 1 , forShell : 1 } );
shellPrintHelper( updateReturn );
defaultPrompt();

checkgle("'final'");