summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-06-23 21:06:43 -0400
committerEliot Horowitz <eliot@10gen.com>2012-06-23 21:06:43 -0400
commit52fa01b3700769b2bbf3090b44ea2d3cbd0a2ebb (patch)
tree594275893dfb2fd8b9742ba0eb545fa64c720777
parentc1c5469ce96c833476f01d70c052cc74dce9b004 (diff)
downloadmongo-52fa01b3700769b2bbf3090b44ea2d3cbd0a2ebb.tar.gz
try to make features3 more reliable
-rw-r--r--jstests/sharding/features3.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/jstests/sharding/features3.js b/jstests/sharding/features3.js
index d13f09b9461..be07c74e941 100644
--- a/jstests/sharding/features3.js
+++ b/jstests/sharding/features3.js
@@ -45,9 +45,11 @@ print( "about to fork shell: " + Date() )
// TODO: Still potential problem when our sampling of current ops misses when $where is active -
// solution is to increase sleep time
-parallelCommand = "try { while(true){" +
- " db.foo.find( function(){ x = ''; for ( i=0; i<10000; i++ ){ x+=i; } sleep( 1000 ); return true; } ).itcount() " +
- "}} catch(e){ print('PShell execution ended:'); printjson( e ) }"
+whereKillSleepTime = 10000;
+parallelCommand =
+ "try { " +
+ " db.foo.find( function(){ sleep( " + whereKillSleepTime + " ); return false; } ).itcount(); " +
+ "} catch(e){ print('PShell execution ended:'); printjson( e ) }"
join = startParallelShell( parallelCommand )
print( "after forking shell: " + Date() )
@@ -105,8 +107,8 @@ assert.eq( 2 , state , "failed killing" );
killTime = (new Date()).getTime() - killTime.getTime()
print( "killTime: " + killTime );
-
-assert.gt( 10000 , killTime , "took too long to kill" )
+print( "time if run full: " + ( N * whereKillSleepTime ) );
+assert.gt( whereKillSleepTime * N / 20 , killTime , "took too long to kill" )
join()