summaryrefslogtreecommitdiff
path: root/jstests/evalc.js
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-09-24 19:01:03 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-09-24 19:01:03 +0200
commit0ad0c09511a04ebe837f2acb859d47f2aa4e038a (patch)
tree109babcb556f6c5884b77853120717f0617c7a1e /jstests/evalc.js
parent03e58f81cad8dd4cfcd1530f327116f0cff6ceb3 (diff)
downloadmongodb-0ad0c09511a04ebe837f2acb859d47f2aa4e038a.tar.gz
Imported Upstream version 1.6.3
Diffstat (limited to 'jstests/evalc.js')
-rw-r--r--jstests/evalc.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/jstests/evalc.js b/jstests/evalc.js
new file mode 100644
index 0000000..59c9467
--- /dev/null
+++ b/jstests/evalc.js
@@ -0,0 +1,32 @@
+t = db.jstests_evalc;
+t.drop();
+
+for( i = 0; i < 10; ++i ) {
+ t.save( {i:i} );
+}
+
+// SERVER-1610
+
+function op() {
+ uri = db.runCommand( "whatsmyuri" ).you;
+ printjson( uri );
+ p = db.currentOp().inprog;
+ for ( var i in p ) {
+ var o = p[ i ];
+ if ( o.client == uri ) {
+ print( "found it" );
+ return o.opid;
+ }
+ }
+ return -1;
+}
+
+s = startParallelShell( "print( 'starting forked:' + Date() ); for ( i=0; i<500000; i++ ){ db.currentOp(); } print( 'ending forked:' + Date() ); " )
+
+print( "starting eval: " + Date() )
+for ( i=0; i<20000; i++ ){
+ db.eval( "db.jstests_evalc.count( {i:10} );" );
+}
+print( "end eval: " + Date() )
+
+s();