diff options
author | Geert Bosch <geert@mongodb.com> | 2015-11-19 13:25:20 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2015-11-19 18:05:25 -0500 |
commit | 23245d6bb38a2a2fa2a4266a1527c82d8ca3736f (patch) | |
tree | 7a9322b6fe6bd466b56f3f9e7c7fa99ccb8dc663 /jstests | |
parent | 962228de85d7361e7e578c2266c9f1d603209426 (diff) | |
download | mongo-23245d6bb38a2a2fa2a4266a1527c82d8ca3736f.tar.gz |
SERVER-21530: Pass cache size and canonical name explicitly to WiredTigerKVEngine
Similarly for the index and record store.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/wt_index_option_defaults.js | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/jstests/noPassthrough/wt_index_option_defaults.js b/jstests/noPassthrough/wt_index_option_defaults.js index e37568fe8c9..231162f207a 100644 --- a/jstests/noPassthrough/wt_index_option_defaults.js +++ b/jstests/noPassthrough/wt_index_option_defaults.js @@ -3,21 +3,27 @@ * preference: * 1. index-specific options specified to createIndex(). * 2. collection-wide options specified as "indexOptionDefaults" to createCollection(). - * 3. system-wide options specified by --wiredTigerIndexConfigString. + * 3. system-wide options specified by --wiredTigerIndexConfigString or by + * inMemoryIndexConfigString. */ (function() { 'use strict'; - // Skip this test if not running with the "wiredTiger" storage engine. - if (jsTest.options().storageEngine && jsTest.options().storageEngine !== 'wiredTiger') { - jsTest.log('Skipping test because storageEngine is not "wiredTiger"'); + var engine = 'wiredTiger'; + if (jsTest.options().storageEngine) { + engine = jsTest.options().storageEngine; + } + + // Skip this test if not running with the right storage engine. + if (engine !== 'wiredTiger' && engine !== 'inMemory') { + jsTest.log('Skipping test because storageEngine is not "wiredTiger" or "inMemory"'); return; } - // Skip this test when 'wiredTigerIndexConfigString' is already set in TestData. + // Skip this test when 'xxxIndexConfigString' is already set in TestData. // TODO: This test can be enabled when MongoRunner supports combining WT config strings with // commas. - if (jsTest.options().wiredTigerIndexConfigString) { + if (jsTest.options()[engine + 'IndexConfigString']) { jsTest.log('Skipping test because system-wide defaults for index options are already set'); return; } @@ -47,23 +53,23 @@ var dbpath = MongoRunner.dataPath + 'wt_index_option_defaults'; resetDbpath(dbpath); - // Start a mongod with system-wide defaults for WiredTiger-specific index options. + // Start a mongod with system-wide defaults for engine-specific index options. var conn = MongoRunner.runMongod({ dbpath: dbpath, noCleanData: true, - wiredTigerIndexConfigString: systemWideConfigString + [engine + 'IndexConfigString']: systemWideConfigString, }); assert.neq(null, conn, 'mongod was unable to start up'); var testDB = conn.getDB('test'); var cmdObj = {create: 'coll'}; - // Apply collection-wide defaults for WiredTiger-specific index options if any were + // Apply collection-wide defaults for engine-specific index options if any were // specified. if (hasIndexOptionDefaults) { cmdObj.indexOptionDefaults = { storageEngine: { - wiredTiger: { + [engine]: { configString: collOptions.indexOptionDefaults } } @@ -71,13 +77,13 @@ } assert.commandWorked(testDB.runCommand(cmdObj)); - // Create an index that does not specify any WiredTiger-specific options. + // Create an index that does not specify any engine-specific options. assert.commandWorked(testDB.coll.createIndex({a: 1}, {name: 'without_options'})); - // Create an index that specifies WiredTiger-specific index options. + // Create an index that specifies engine-specific index options. assert.commandWorked(testDB.coll.createIndex({b: 1}, { name: 'with_options', - storageEngine: {wiredTiger: {configString: indexSpecificConfigString}} + storageEngine: {[engine]: {configString: indexSpecificConfigString}} })); var collStats = testDB.runCommand({collStats: 'coll'}); @@ -121,9 +127,9 @@ assert(indexSpec.hasOwnProperty('storageEngine'), 'storage engine options should have been set in the index spec: ' + tojson(indexSpec)); - assert.docEq({wiredTiger: {configString: indexSpecificConfigString}}, + assert.docEq({[engine]: {configString: indexSpecificConfigString}}, indexSpec.storageEngine, - 'WiredTiger index options not present in the index spec'); + engine + ' index options not present in the index spec'); var creationString = indexDetails.with_options.creationString; assert.eq(-1, creationString.indexOf(systemWideConfigString), |