summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/disk/preallocate.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/disk/preallocate.js b/jstests/disk/preallocate.js
new file mode 100644
index 00000000000..7ce3d40a412
--- /dev/null
+++ b/jstests/disk/preallocate.js
@@ -0,0 +1,19 @@
+var baseName = "jstests_preallocate";
+
+vsize = function() {
+ return m.getDB( "admin" ).runCommand( "serverStatus" ).mem.virtual;
+}
+
+var m = startMongod( "--port", "27018", "--dbpath", "/data/db/" + baseName );
+
+m.getDB( baseName ).createCollection( baseName + "1" );
+
+vs = vsize();
+
+stopMongod( 27018 );
+
+var m = startMongoProgram( "mongod", "--port", "27018", "--dbpath", "/data/db/" + baseName );
+
+m.getDB( baseName ).createCollection( baseName + "2" );
+
+assert.eq( vs, vsize() );