summaryrefslogtreecommitdiff
path: root/jstests/sharding/features3.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-08-30 10:26:20 -0400
committerEliot Horowitz <eliot@10gen.com>2010-08-30 10:26:33 -0400
commit7550b02cecc503351456e171c0ff0e2d2e7ad97e (patch)
treeead3733fcf5a26ccb30088a30f96bde710213d0a /jstests/sharding/features3.js
parentcf5470b58e34f79542a3788de82be5f46e2f4aa8 (diff)
downloadmongo-7550b02cecc503351456e171c0ff0e2d2e7ad97e.tar.gz
debugging for shardign/features3
Diffstat (limited to 'jstests/sharding/features3.js')
-rw-r--r--jstests/sharding/features3.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/sharding/features3.js b/jstests/sharding/features3.js
index 2b437e93fdc..ca6f41d67bc 100644
--- a/jstests/sharding/features3.js
+++ b/jstests/sharding/features3.js
@@ -27,8 +27,10 @@ print( "about to fork shell: " + Date() )
join = startParallelShell( "db.foo.find( function(){ x = \"\"; for ( i=0; i<5000; i++ ){ x+=i; } return true; } ).itcount()" )
print( "after forking shell: " + Date() )
-function getMine(){
+function getMine( printInprog ){
var inprog = db.currentOp().inprog;
+ if ( printInprog )
+ printjson( inprog )
var mine = []
for ( var x=0; x<inprog.length; x++ ){
if ( inprog[x].query && inprog[x].query.$where ){
@@ -42,7 +44,7 @@ state = 0; // 0 = not found, 1 = killed,
killTime = null;
for ( i=0; i<200000; i++ ){
- mine = getMine();
+ mine = getMine( state == 0 && i > 20 );
if ( state == 0 ){
if ( mine.length == 0 ){
sleep(1);
@@ -63,10 +65,12 @@ for ( i=0; i<200000; i++ ){
print( "after loop: " + Date() );
assert( killTime , "timed out waiting too kill last mine:" + tojson(mine) )
+
+assert.eq( 2 , state , "failed killing" );
+
killTime = (new Date()).getTime() - killTime.getTime()
print( "killTime: " + killTime );
-assert.eq( 2 , state , "failed killing" );
assert.gt( 10000 , killTime , "took too long to kill" )
join()