summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/explain2.js
blob: 0720091e4a44205257b54041c3efe4a1cffafe9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test for race condition SERVER-2807.  One cursor is dropped and another is not.
// @tags: [requires_capped]

collName = 'jstests_slowNightly_explain2';

t = db[collName];
t.drop();

db.createCollection(collName, {capped: true, size: 100000});
t = db[collName];
t.createIndex({x: 1});

a = startParallelShell('for( i = 0; i < 50000; ++i ) { db.' + collName + '.insert( {x:i,y:1} ); }');

for (i = 0; i < 800; ++i) {
    t.find({x: {$gt: -1}, y: 1}).sort({x: -1}).explain();
}

a();