Files
mongo/jstests/disk/preallocate2.js
Eliot Horowitz 29f2a72a13 fix preallocate2
2011-01-20 21:56:23 -05:00

16 lines
509 B
JavaScript

// check that there is preallocation on insert
port = allocatePorts( 1 )[ 0 ];
var baseName = "jstests_preallocate2";
var m = startMongod( "--port", port, "--dbpath", "/data/db/" + baseName );
m.getDB( baseName )[ baseName ].save( {i:1} );
expectedMB = 100;
if ( m.getDB( baseName ).serverBits() < 64 )
expectedMB /= 4;
assert.soon( function() { return m.getDBs().totalSize > expectedMB * 1000000; }, "\n\n\nFAIL preallocate.js expected second file to bring total size over " + expectedMB + "MB" );