diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2015-10-22 23:46:40 -0400 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2015-10-22 23:46:40 -0400 |
commit | 5bf9355aed2c37c4044f9defbddc707f9ff67e6e (patch) | |
tree | 418c999e71a795cebf5fd10eb49e9f36d7dece41 | |
parent | 56901168cea650d4080fe3fadd283e5127924c34 (diff) | |
download | mongo-5bf9355aed2c37c4044f9defbddc707f9ff67e6e.tar.gz |
Revert "SERVER-20489 Remove sleep workaround from readmajority_jscore_passthrough.js"
This reverts commit 56901168cea650d4080fe3fadd283e5127924c34.
3 files changed, 72 insertions, 99 deletions
diff --git a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml index a2e2a9503bd..34963ef9641 100644 --- a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml @@ -4,34 +4,11 @@ selector: - jstests/core/*.js exclude_files: # Tests that won't work with an injected 'majority' readConcern - # and/or an injected 'majority' writeConcern. Where a function is - # listed the reason is we don't have a reliable solution to override - # the write concern for that function. - - jstests/core/apply_ops1.js # applyOps() used for writes + # and/or an injected 'majority' writeConcern + - jstests/core/array_match4.js # checks commands with various write concerns - jstests/core/batch_write_command*.js # these tests use various write concerns - - jstests/core/bench_test_crud_commands.js # benchRun() used for writes - jstests/core/crud_api.js # has specific w:0 tests - - jstests/core/error2.js # db.eval() used - - jstests/core/eval0.js # db.eval() used - - jstests/core/eval1.js # db.eval() used - - jstests/core/eval3.js # db.eval() used - - jstests/core/eval4.js # db.eval() used - - jstests/core/eval5.js # db.eval() used - - jstests/core/eval6.js # db.eval() used - - jstests/core/eval7.js # db.eval() used - - jstests/core/eval9.js # db.eval() used - - jstests/core/evala.js # db.eval() used - - jstests/core/evalb.js # db.eval() used - - jstests/core/evalc.js # db.eval() used - - jstests/core/evald.js # db.eval() used - - jstests/core/evale.js # db.eval() used - - jstests/core/evalg.js # db.eval() used - - jstests/core/eval_mr.js # db.eval() used - - jstests/core/eval_nolock.js # db.eval() used - - jstests/core/geo_s2cursorlimitskip.js # drops system.profile collection and counts ops. - - jstests/core/js3.js # db.dbEval() used - - jstests/core/js7.js # db.eval() used - - jstests/core/js9.js # db.eval() used + - jstests/core/evalb.js # system.profile not replicated - jstests/core/mr_merge.js # mr temp tables aren't replicated - jstests/core/mr_merge2.js # mr temp tables aren't replicated - jstests/core/mr_outreduce.js # mr temp tables aren't replicated @@ -44,24 +21,27 @@ selector: - jstests/core/profile4.js # system.profile not replicated - jstests/core/profile5.js # system.profile not replicated - jstests/core/read_after_optime.js # verifies read after optime fails on standalone - - jstests/core/remove8.js # db.eval() used - - jstests/core/rename4.js # db.eval() used - jstests/core/shell1.js # tests setSlaveOk() variations on standalone mongod - - jstests/core/shellkillop.js # db.eval() used - jstests/core/shell_writeconcern.js # checks write concern shell helpers - - jstests/core/storefunc.js # db.eval() used + # Timing / excessive run time with sleep workaround in place for SERVER-20260 + - jstests/core/index_create_too_many.js + - jstests/core/index_many2.js + - jstests/core/index_many.js + # Tests that are flaky with the level of sleep we've set + - jstests/core/apply_ops1.js + - jstests/core/eval6.js + - jstests/core/geo_s2cursorlimitskip.js + - jstests/core/plan_cache_clear.js + - jstests/core/stages_delete.js + - jstests/core/updatej.js # Tests that need triaging & remediation | blacklist decision - # Comments list possible problem point under review. - - jstests/core/capped6.js # Uses captrunc test command. - - jstests/core/convert_to_capped_nonexistant.js # Uses convertToCapped and captrunc command. - - jstests/core/stages_delete.js # Uses stageDebug command for deletes. - + - jstests/core/capped6.js # might be autoIndexId executor: js_test: config: shell_options: - eval: "var testingReplication = true;load('jstests/libs/override_methods/set_majority_read_and_write_concerns.js');" + eval: "var testingReplication = true;load('jstests/slow2/readmajority_jscore_passthrough.js');" readMode: commands fixture: class: ReplicaSetFixture @@ -69,4 +49,6 @@ executor: set_parameters: enableTestCommands: 1 enableMajorityReadConcern: '' - num_nodes: 2 + # Running with one node until SERVER-20260 in place. Allows us to use a much smaller sleep. + # Bring up to two or three once fixed. + num_nodes: 1 diff --git a/jstests/libs/override_methods/set_majority_read_and_write_concerns.js b/jstests/libs/override_methods/set_majority_read_and_write_concerns.js deleted file mode 100644 index 47ad3e95053..00000000000 --- a/jstests/libs/override_methods/set_majority_read_and_write_concerns.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Use prototype overrides to set a read concern of "majority" and a write concern of "majority" - * while running core tests. - */ -(function() { - "use strict"; - var defaultWriteConcern = {w: "majority", wtimeout: 60000}; - - var originalStartParallelShell = startParallelShell; - startParallelShell = function(jsCode, port, noConnect) { - var newCode; - var overridesFile = "jstests/libs/override_methods/set_majority_read_and_write_concerns.js"; - - if (typeof(jsCode) === "function") { - // Load the override file and immediately invoke the supplied function. - newCode = `load("${overridesFile}"); (${jsCode})();` - } else { - newCode = `load("${overridesFile}"); ${jsCode};` - } - - return originalStartParallelShell(newCode, port, noConnect); - } - - DB.prototype._runCommandImpl = function(name, obj, options) { - if (obj.hasOwnProperty("createIndexes") || - obj.hasOwnProperty("delete") || - obj.hasOwnProperty("findAndModify") || - obj.hasOwnProperty("findandmodify") || - obj.hasOwnProperty("insert") || - obj.hasOwnProperty("update")) { - if (obj.hasOwnProperty("writeConcern")) { - jsTestLog("Warning: overriding existing writeConcern of: " + - obj.writeConcern); - } - obj.writeConcern = defaultWriteConcern; - - } else if (obj.hasOwnProperty("aggregate") || - obj.hasOwnProperty("count") || - obj.hasOwnProperty("dbStats") || - obj.hasOwnProperty("distinct") || - obj.hasOwnProperty("explain") || - obj.hasOwnProperty("find") || - obj.hasOwnProperty("geoNear") || - obj.hasOwnProperty("geoSearch") || - obj.hasOwnProperty("group")) { - if (obj.hasOwnProperty("readConcern")) { - jsTestLog("Warning: overriding existing readConcern of: " + - obj.readConcern); - } - obj.readConcern = {level: "majority"}; - } - - return this.getMongo().runCommand(name, obj, options); - }; - - // Use a majority write concern if the operation does not specify one. - DBCollection.prototype.getWriteConcern = function() { - return new WriteConcern(defaultWriteConcern); - }; - -})(); - diff --git a/jstests/slow2/readmajority_jscore_passthrough.js b/jstests/slow2/readmajority_jscore_passthrough.js new file mode 100644 index 00000000000..f7ece2c5d1a --- /dev/null +++ b/jstests/slow2/readmajority_jscore_passthrough.js @@ -0,0 +1,53 @@ +/** + * Use prototype overrides to set a read concern of "majority" and a write concern of "majority" + * while running core tests. + */ +(function() { + "use strict"; + var defaultWriteConcern = {w: "majority", wtimeout: 60000}; + + DB.prototype._runCommandImpl = function(name, obj, options) { + var indexWait = false; + if (obj.hasOwnProperty("createIndexes") || + obj.hasOwnProperty("delete") || + obj.hasOwnProperty("findAndModify") || + obj.hasOwnProperty("findandmodify") || + obj.hasOwnProperty("insert") || + obj.hasOwnProperty("update")) { + if (obj.hasOwnProperty("writeConcern")) { + jsTestLog("Warning: overriding existing writeConcern of: " + + obj.writeConcern); + } + // SERVER-20260 workaround + if (obj.hasOwnProperty("createIndexes")) { + indexWait = true; + } + obj.writeConcern = defaultWriteConcern; + } else if (obj.hasOwnProperty("aggregate") || + obj.hasOwnProperty("count") || + obj.hasOwnProperty("dbStats") || + obj.hasOwnProperty("distinct") || + obj.hasOwnProperty("explain") || + obj.hasOwnProperty("find") || + obj.hasOwnProperty("geoNear") || + obj.hasOwnProperty("geoSearch") || + obj.hasOwnProperty("group")) { + obj.readConcern = {level: "majority"}; + } + + var res = this.getMongo().runCommand(name, obj, options); + if (indexWait) { + print("Sleeping as workaround for SERVER-20260"); + sleep(5*1000); + } + return res; + }; + + + // Use a majority write concern if the operation does not specify one. + DBCollection.prototype.getWriteConcern = function() { + return new WriteConcern(defaultWriteConcern); + }; + +})(); + |