summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/explain1.js
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-03-27 16:15:09 -0400
committerMathias Stearn <mathias@10gen.com>2014-03-27 17:35:16 -0400
commitd0a1e84ab2fa1b6aa699721b5cb9a4f8d0bf3692 (patch)
tree7a1ffc91cb6cb176c1e367ea7641ab05032c862c /jstests/noPassthroughWithMongod/explain1.js
parent719134aa7985c0a697f199fc78e323d04e3a65ad (diff)
downloadmongo-d0a1e84ab2fa1b6aa699721b5cb9a4f8d0bf3692.tar.gz
SERVER-13391 Rename slowNightly -> noPassthroughWithMongod and slowWeekly -> noPassthrough
This better represents their purpose and the difference between them.
Diffstat (limited to 'jstests/noPassthroughWithMongod/explain1.js')
-rw-r--r--jstests/noPassthroughWithMongod/explain1.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/explain1.js b/jstests/noPassthroughWithMongod/explain1.js
new file mode 100644
index 00000000000..81baeb6e918
--- /dev/null
+++ b/jstests/noPassthroughWithMongod/explain1.js
@@ -0,0 +1,17 @@
+// SERVER-2662 - drop client cursor in a context where query will yield frequently
+
+t = db.jstests_slowNightly_explain1;
+t.drop();
+
+// Periodically drops the collection, invalidating client cursors for s2's operations.
+s1 = startParallelShell( "t = db.jstests_slowNightly_explain1; for( var i = 0; i < 80; ++i ) { t.drop(); t.ensureIndex({x:1}); for( var j = 0; j < 1000; ++j ) { t.save( {x:j,y:1} ) }; sleep( 100 ); }" );
+
+// Query repeatedly.
+s2 = startParallelShell( "t = db.jstests_slowNightly_explain1; for( var i = 0; i < 500; ++i ) { try { z = t.find( {x:{$gt:0},y:1} ).explain(); t.count( {x:{$gt:0},y:1} ); } catch( e ) {} }" );
+
+// Put pressure on s2 to yield more often.
+s3 = startParallelShell( "t = db.jstests_slowNightly_explain1; for( var i = 0; i < 200; ++i ) { t.validate({scandata:true}); }" );
+
+s1();
+s2();
+s3();