diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2017-09-12 12:16:23 -0400 |
---|---|---|
committer | Henrik Edin <henrik.edin@mongodb.com> | 2017-09-13 11:36:54 -0400 |
commit | 6fa43b840dbd493e0e8f53579b4e2e7d0d482abc (patch) | |
tree | 6869c1fb47da4f1838b238d6f0c6704bc3114022 /jstests/core/dbstats.js | |
parent | d0fe72bb292faa5c00424713d3a535974ce85d75 (diff) | |
download | mongo-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.js | 10 |
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)); } |