Files
mongo/jstests/disk/preallocate2.js
2016-03-09 12:18:14 -05:00

17 lines
499 B
JavaScript

// check that there is preallocation on insert
var baseName = "jstests_preallocate2";
var m = MongoRunner.runMongod({});
m.getDB(baseName)[baseName].save({i: 1});
// Windows does not currently use preallocation
expectedMB = (_isWindows() ? 70 : 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");