summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/explain2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/explain2.js')
-rw-r--r--jstests/noPassthroughWithMongod/explain2.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/explain2.js b/jstests/noPassthroughWithMongod/explain2.js
new file mode 100644
index 00000000000..032f0fa8de8
--- /dev/null
+++ b/jstests/noPassthroughWithMongod/explain2.js
@@ -0,0 +1,18 @@
+// Test for race condition SERVER-2807. One cursor is dropped and another is not.
+
+collName = 'jstests_slowNightly_explain2';
+
+t = db[ collName ];
+t.drop();
+
+db.createCollection( collName, {capped:true,size:100000} );
+t = db[ collName ];
+t.ensureIndex( {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(); \ No newline at end of file