0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

MINOR always allocate new extents when 'nExtents' debug parameter is specified, to avoid occasional capped2.js failures

This commit is contained in:
Aaron 2010-01-05 09:54:01 -08:00
parent 8833b6dc37
commit df1c01d6fe
2 changed files with 10 additions and 2 deletions

View File

@ -134,7 +134,10 @@ namespace mongo {
assert( size <= 0x7fffffff );
for ( int i = 0; i < nExtents; ++i ) {
assert( size <= 0x7fffffff );
database->allocExtent( ns, (int) size, newCapped );
// $nExtents is just for testing - always allocate new extents
// rather than reuse existing extents so we have some predictibility
// in the extent size used by our tests
database->suitableFile( size )->createExtent( ns, (int) size, newCapped );
}
} else {
while ( size > 0 ) {

View File

@ -17,7 +17,12 @@ function checkIncreasing( i ) {
assert( res.hasNext(), "A" );
var j = i;
while( res.hasNext() ) {
assert.eq( val[ j-- ].a, res.next().a, "B" );
try {
assert.eq( val[ j-- ].a, res.next().a, "B" );
} catch( e ) {
debug( "capped2 err " + j );
throw e;
}
}
res = tzz.find().sort( { $natural: 1 } );
assert( res.hasNext(), "C" );