diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-04-07 07:36:09 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-04-07 07:36:09 +0200 |
commit | 59ecbfc865d5711bea8fa095eea6f8dc194209c1 (patch) | |
tree | 5ee9b45706b9ac72c06dc1e4035b14b856cc29df /jstests/slowNightly/explain1.js | |
parent | 4c744c57a43222a726a34b3253fce6108a140e46 (diff) | |
parent | 8d913e98e8058c6322975a858f884a769735bb43 (diff) | |
download | mongodb-59ecbfc865d5711bea8fa095eea6f8dc194209c1.tar.gz |
Merge commit 'upstream/1.8.1'
Diffstat (limited to 'jstests/slowNightly/explain1.js')
-rw-r--r-- | jstests/slowNightly/explain1.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/slowNightly/explain1.js b/jstests/slowNightly/explain1.js new file mode 100644 index 0000000..81baeb6 --- /dev/null +++ b/jstests/slowNightly/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(); |