diff options
author | Randolph Tan <randolph@10gen.com> | 2013-11-26 11:19:05 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2013-11-26 11:19:05 -0500 |
commit | 86b4f30e0359f02777739cc15cdd6052cfdafeaa (patch) | |
tree | 5c59a029cfb3657197f61f005ccb3613e2760414 | |
parent | 6015f1f2706201e52f66eede33ef41114dec5550 (diff) | |
download | mongo-86b4f30e0359f02777739cc15cdd6052cfdafeaa.tar.gz |
SERVER-11772 new jstest suites for write command testing
Added sharding and dur passthrough for jsCore
-rw-r--r-- | jstests/dur/dur_jscore_passthrough.js | 59 | ||||
-rw-r--r-- | jstests/slowNightly/sharding_jscore_passthrough.js | 165 |
2 files changed, 224 insertions, 0 deletions
diff --git a/jstests/dur/dur_jscore_passthrough.js b/jstests/dur/dur_jscore_passthrough.js new file mode 100644 index 00000000000..d79b64ee14b --- /dev/null +++ b/jstests/dur/dur_jscore_passthrough.js @@ -0,0 +1,59 @@ +// +// simple runner to run toplevel tests in jstests +// + +//TODO(mathias) add --master or make another test +//conn = startMongodEmpty("--port", 30200, "--dbpath", MongoRunner.dataDir + "/dur_passthrough", "--dur", "--smallfiles", "--durOptions", "24"); + +conn = startMongodEmpty("--port", 30200, "--dbpath", MongoRunner.dataDir + "/dur_passthrough", "--dur", "--nopreallocj", "--smallfiles", +"--durOptions", "8"); +db = conn.getDB("test"); +conn._useWriteCommands = true; + +function doTest() { + var files = listFiles("jstests/core"); + files = files.sort(compareOn('name')); + + var runnerStart = new Date() + + files.forEach( + function (x) { + + if (/[\/\\]_/.test(x.name) || + !/\.js$/.test(x.name) || + /repair/.test(x.name) || // fails on recovery + /shellkillop/.test(x.name) || // takes forever and don't test anything new + false // placeholder so all real tests end in || + ) + { + print(" >>>>>>>>>>>>>>> skipping " + x.name); + return; + } + + print(); + print(" *******************************************"); + print(" Test : " + x.name + " ..."); + print(" " + Date.timeFunc(function () { load(x.name); }, 1) + "ms"); + gc(); // TODO SERVER-8683: remove gc() calls once resolved + } + ); + + stopMongod(30200); + + var runnerEnd = new Date() + + print( "total runner time: " + ( ( runnerEnd.getTime() - runnerStart.getTime() ) / 1000 ) + "secs" ) +} + +if (db.serverBuildInfo().bits == 64 && + db.serverBuildInfo().debug == false && + db.hostInfo().os.type == "Linux") +{ + doTest(); +} +else { + print("Skipping. Only run this test on non-debug, 64bit, Linux builds"); +} + +//TODO(mathias): test recovery here + diff --git a/jstests/slowNightly/sharding_jscore_passthrough.js b/jstests/slowNightly/sharding_jscore_passthrough.js new file mode 100644 index 00000000000..ae6d84f881a --- /dev/null +++ b/jstests/slowNightly/sharding_jscore_passthrough.js @@ -0,0 +1,165 @@ +var myShardingTest = new ShardingTest("sharding_passthrough", 2, 0, 1); +myShardingTest.adminCommand({ enablesharding : "test" }); +var db = myShardingTest.getDB("test"); +db.getMongo()._useWriteCommands = true; +var res = db.adminCommand({ setParameter: 1, useClusterWriteCommands: true }); +var files = listFiles("jstests/core"); + +var runnerStart = new Date(); + +files.forEach(function(x) { + if (/[\/\\]_/.test(x.name) || ! /\.js$/.test(x.name)) { + print(" >>>>>>>>>>>>>>> skipping " + x.name); + return; + } + + // Notes: + + // apply_ops1, apply_ops2: nothing works, dunno why yet. SERVER-1439. + + // copydb, copydb2: copyDatabase seems not to work at all in + // the ShardingTest setup. SERVER-1440. + + // cursor8: cursorInfo different/meaningless(?) in mongos. + // closeAllDatabases may not work through mongos + // SERVER-1441. + // deal with cursorInfo in mongos SERVER-1442. + + // dbcase: Database names are case-insensitive under ShardingTest? + // SERVER-1443. + + // These are all SERVER-1444 + // count5: limit() and maybe skip() may be unreliable. + // geo3: limit() not working, I think. + // or4: skip() not working? + + // shellkillop: dunno yet. SERVER-1445 + + // update_setOnInsert: db.setPrifilingLevel is not working. SERVER-8653 + + // These should simply not be run under sharding: + // dbadmin: Uncertain Cut-n-pasting its contents into mongo worked. + // error1: getpreverror not supported under sharding. + // fsync, fsync2: isn't supported through mongos. + // remove5: getpreverror, I think. don't run. + // update4: getpreverror don't run. + + // Around July 20, command passthrough went away, and these + // commands weren't implemented: + // clean cloneCollectionAsCapped copydbgetnonce dataSize + // datasize dbstats deleteIndexes dropIndexes forceerror + // getnonce logout medianKey profile reIndex repairDatabase + // reseterror splitVector validate + + /* missing commands : + * forceerror and switchtoclienterrors + * cloneCollectionAsCapped + * splitvector + * profile (apitest_db, cursor6, evalb) + * copydbgetnonce + * dbhash + * medianKey + * clean (apitest_dbcollection) + * logout and getnonce + */ + + var failsInShardingPattern = new RegExp('[\\/\\\\](' + + 'error3|' + + 'capped.*|' + + 'apitest_db|' + + 'cursor6|' + + 'copydb-auth|' + + 'profile\\d*|' + + 'dbhash|' + + 'dbhash2|' + + 'median|' + + 'apitest_dbcollection|' + + 'evalb|' + + 'evald|' + + 'eval_nolock|' + + 'auth1|' + + 'auth2|' + + 'dropdb_race|' + + 'unix_socket\\d*' + + ')\.js$'); + + // These are bugs (some might be fixed now): + var mightBeFixedPattern = new RegExp('[\\/\\\\](' + + 'apply_ops[12]|' + + 'count5|' + + 'cursor8|' + + 'or4|' + + 'shellkillop|' + + 'update4|' + + 'update_setOnInsert|' + + 'profile\\d*|' + + 'max_time_ms|' + // Will be fixed when SERVER-2212 is resolved. + 'fts_querylang|' + // Will be fixed when SERVER-9063 is resolved. + 'fts_projection' + + ')\.js$'); + + // These aren't supposed to get run under sharding: + var notForShardingPattern = new RegExp('[\\/\\\\](' + + 'dbadmin|' + + 'error1|' + + 'fsync|' + + 'fsync2|' + + 'geo.*|' + + 'indexh|' + + 'remove5|' + + 'update4|' + + 'loglong|' + + 'logpath|' + + 'notablescan|' + + 'compact.*|' + + 'check_shard_index|' + + 'bench_test.*|' + + 'mr_replaceIntoDB|' + + 'mr_auth|' + + 'queryoptimizera|' + + 'indexStatsCommand|' + + 'reversecursor|' + + 'block_check_supported|' + + 'stages.*|' + + 'touch1|' + + 'dbcase|' + // undo after fixing SERVER-11735 + 'stats' + // tests db.stats().dataFileVersion, which doesn't appear in sharded db.stats() + ')\.js$'); + + if (failsInShardingPattern.test(x.name)) { + print(" !!!!!!!!!!!!!!! skipping test that has failed under sharding " + + "but might not anymore " + x.name); + return; + } + + if (mightBeFixedPattern.test(x.name)) { + print(" !!!!!!!!!!!!!!! skipping test that has failed under sharding " + + "but might not anymore " + x.name); + return; + } + + if (notForShardingPattern.test(x.name)) { + print(" >>>>>>>>>>>>>>> skipping test that would correctly fail under sharding " + x.name); + return; + } + + print(" *******************************************"); + print(" Test : " + x.name + " ..."); + print(" " + + Date.timeFunc(function() { + load(x.name); + }, 1) + "ms"); + + gc(); // TODO SERVER-8683: remove gc() calls once resolved + + // Reset "db" variable, just in case someone broke the rules and used it themselves + db = myShardingTest.getDB("test"); +}); + + +myShardingTest.stop(); + +var runnerEnd = new Date(); + +print("total runner time: " + ((runnerEnd.getTime() - runnerStart.getTime()) / 1000) + "secs"); + |