diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-08-15 11:18:18 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-08-15 11:18:18 -0400 |
commit | 93ba91bdf9ce4721a5467e5d35118b16f04c2577 (patch) | |
tree | a9c44979befa209e1f2d739a24d6b2cd31767621 | |
parent | a1042b421b4a1f046a0228ef316c95f001a4781b (diff) | |
download | mongo-93ba91bdf9ce4721a5467e5d35118b16f04c2577.tar.gz |
SERVER-13635: make capped8 a bit more generous as we push more data through now
-rw-r--r-- | jstests/core/capped8.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/jstests/core/capped8.js b/jstests/core/capped8.js index 9eaa4aedd10..13da7863d4f 100644 --- a/jstests/core/capped8.js +++ b/jstests/core/capped8.js @@ -13,8 +13,8 @@ function obj( size, x ) { return {X:x, a:new Array( size + 1 ).toString()};; } -function withinOne( a, b ) { - assert( Math.abs( a - b ) <= 1, "not within one: " + a + ", " + b ) +function withinTwo( a, b ) { + assert( Math.abs( a - b ) <= 2, "not within one: " + a + ", " + b ) } var X = 0; @@ -66,14 +66,15 @@ function insertAndTruncate( first ) { } else { // Check that we are able to insert roughly the same number of documents // after truncating. The exact values are slightly variable as a result - // of the capped allocation algorithm. - withinOne( initialCount, myInitialCount ); - withinOne( fiftyCount, myFiftyCount ); - withinOne( twokCount, myTwokCount ); + // of the capped allocation algorithm and where the remaining entry is. + withinTwo( initialCount, myInitialCount ); + withinTwo( fiftyCount, myFiftyCount ); + withinTwo( twokCount, myTwokCount ); } count = t.count(); // Check that we can truncate the collection successfully. assert.commandWorked( db.runCommand( { captrunc:"jstests_capped8", n:count - 1, inc:false } ) ); + assert.eq( 1, t.count() ); } /** Test truncating and subsequent inserts */ |