diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-03-26 14:15:43 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-03-26 14:15:43 -0400 |
commit | c8dc9110a12fa6d310ef29f4be78e6f0244871ab (patch) | |
tree | a64a95145fd3a2f35959fc03b3323a694fcea9be | |
parent | e1f684532131ac579c0f4e35a46e1a28da6567d8 (diff) | |
download | mongo-c8dc9110a12fa6d310ef29f4be78e6f0244871ab.tar.gz |
make features3 curop test more resilient of timing
-rw-r--r-- | jstests/sharding/features3.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/sharding/features3.js b/jstests/sharding/features3.js index 7c5b720b367..07117fa4770 100644 --- a/jstests/sharding/features3.js +++ b/jstests/sharding/features3.js @@ -123,20 +123,24 @@ assert( ! x.ok , "lock should fail: " + tojson( x ) ) // SERVER-4194 function countWritebacks( curop ) { + print( "---------------" ); var num = 0; for ( var i=0; i<curop.inprog.length; i++ ) { var q = curop.inprog[i].query; - if ( q && q.writebacklisten ) + if ( q && q.writebacklisten ) { + printjson( curop.inprog[i] ); num++; + } } return num; } x = db.currentOp(); -assert.eq( 0 , countWritebacks( x ) , "without all: " + tojson(x) ); +assert.eq( 0 , countWritebacks( x ) , "without all"); x = db.currentOp( true ); -assert.eq( 1 , countWritebacks( x ) , "with all: " + tojson(x) ); +y = countWritebacks( x ) +assert( y == 1 || y == 2 , "with all: " + y ); |