diff options
Diffstat (limited to 'jstests/disk/newcollection.js')
-rw-r--r-- | jstests/disk/newcollection.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/jstests/disk/newcollection.js b/jstests/disk/newcollection.js index e6a79948c9a..aab959b44df 100644 --- a/jstests/disk/newcollection.js +++ b/jstests/disk/newcollection.js @@ -2,27 +2,28 @@ var baseName = "jstests_disk_newcollection"; var m = MongoRunner.runMongod({noprealloc: "", smallfiles: ""}); -db = m.getDB( "test" ); +db = m.getDB("test"); var t = db[baseName]; var getTotalNonLocalSize = function() { var totalNonLocalDBSize = 0; - m.getDBs().databases.forEach( function(dbStats) { + m.getDBs().databases.forEach(function(dbStats) { // We accept the local database's space overhead. - if (dbStats.name == "local") return; + if (dbStats.name == "local") + return; // Databases with "sizeOnDisk=1" and "empty=true" dont' actually take up space o disk. // See SERVER-11051. - if (dbStats.sizeOnDisk == 1 && dbStats.empty) return; + if (dbStats.sizeOnDisk == 1 && dbStats.empty) + return; totalNonLocalDBSize += dbStats.sizeOnDisk; }); return totalNonLocalDBSize; }; for (var pass = 0; pass <= 1; pass++) { - - db.createCollection(baseName, { size: 15.8 * 1024 * 1024 }); - if( pass == 0 ) + db.createCollection(baseName, {size: 15.8 * 1024 * 1024}); + if (pass == 0) t.drop(); size = getTotalNonLocalSize(); |