summaryrefslogtreecommitdiff
path: root/jstests/core/dbstats.js
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2017-09-12 12:16:23 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2017-09-13 11:36:54 -0400
commit6fa43b840dbd493e0e8f53579b4e2e7d0d482abc (patch)
tree6869c1fb47da4f1838b238d6f0c6704bc3114022 /jstests/core/dbstats.js
parentd0fe72bb292faa5c00424713d3a535974ce85d75 (diff)
downloadmongo-6fa43b840dbd493e0e8f53579b4e2e7d0d482abc.tar.gz
SERVER-31074 Fix dbstats.js to properly detect non-persistent storage engines causing ephemeralForTest to fail.
Diffstat (limited to 'jstests/core/dbstats.js')
-rw-r--r--jstests/core/dbstats.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/jstests/core/dbstats.js b/jstests/core/dbstats.js
index 00709fa7d77..6289eab1f08 100644
--- a/jstests/core/dbstats.js
+++ b/jstests/core/dbstats.js
@@ -9,9 +9,15 @@
return res.msg === "isdbgrid";
}
+ function serverUsingPersistentStorage() {
+ const res = db.runCommand("serverStatus");
+ assert.commandWorked(res);
+ return res.storageEngine.persistent === true;
+ }
+
const isMongoS = serverIsMongos();
const isMMAPv1 = jsTest.options().storageEngine === "mmapv1";
- const isInMemory = jsTest.options().storageEngine === "inMemory";
+ const isUsingPersistentStorage = !isMongoS && serverUsingPersistentStorage();
let testDB = db.getSiblingDB("dbstats_js");
assert.commandWorked(testDB.dropDatabase());
@@ -58,7 +64,7 @@
assert(dbStats.hasOwnProperty("numExtents"), tojson(dbStats));
assert(dbStats.hasOwnProperty("indexSize"), tojson(dbStats));
- if (!isMongoS && !isInMemory) {
+ if (isUsingPersistentStorage) {
assert(dbStats.hasOwnProperty("fsUsedSize"), tojson(dbStats));
assert(dbStats.hasOwnProperty("fsTotalSize"), tojson(dbStats));
}