diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2015-09-18 11:59:46 -0400 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2015-10-23 00:20:47 -0400 |
commit | c48ff0ba613fdafd51d26f664371522837809a9d (patch) | |
tree | dd192788864a4e0f0b840f71fdca5c6307c5a3f2 | |
parent | 5bf9355aed2c37c4044f9defbddc707f9ff67e6e (diff) | |
download | mongo-c48ff0ba613fdafd51d26f664371522837809a9d.tar.gz |
SERVER-20489 Remove sleep workaround from readmajority_jscore_passthrough.js
Previously reverted because the slow2.yml changes were left out.
4 files changed, 99 insertions, 76 deletions
diff --git a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml index 34963ef9641..a2e2a9503bd 100644 --- a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml @@ -4,11 +4,34 @@ selector: - jstests/core/*.js exclude_files: # Tests that won't work with an injected 'majority' readConcern - # and/or an injected 'majority' writeConcern - - jstests/core/array_match4.js # checks commands with various write concerns + # 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 - 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/evalb.js # system.profile not replicated + - 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/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 @@ -21,27 +44,24 @@ 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 - # 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 + - jstests/core/storefunc.js # db.eval() used # Tests that need triaging & remediation | blacklist decision - - jstests/core/capped6.js # might be autoIndexId + # 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. + executor: js_test: config: shell_options: - eval: "var testingReplication = true;load('jstests/slow2/readmajority_jscore_passthrough.js');" + eval: "var testingReplication = true;load('jstests/libs/override_methods/set_majority_read_and_write_concerns.js');" readMode: commands fixture: class: ReplicaSetFixture @@ -49,6 +69,4 @@ executor: set_parameters: enableTestCommands: 1 enableMajorityReadConcern: '' - # 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 + num_nodes: 2 diff --git a/buildscripts/resmokeconfig/suites/slow2.yml b/buildscripts/resmokeconfig/suites/slow2.yml index 10a1ac2de85..3cf37426a6f 100644 --- a/buildscripts/resmokeconfig/suites/slow2.yml +++ b/buildscripts/resmokeconfig/suites/slow2.yml @@ -2,10 +2,6 @@ selector: js_test: roots: - jstests/slow2/*.js - exclude_files: - # Skip the passthrough tests because each passthrough - # is run as its own independent suite. - - jstests/slow2/readmajority_jscore_passthrough.js executor: js_test: 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 new file mode 100644 index 00000000000..47ad3e95053 --- /dev/null +++ b/jstests/libs/override_methods/set_majority_read_and_write_concerns.js @@ -0,0 +1,62 @@ +/** + * 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 deleted file mode 100644 index f7ece2c5d1a..00000000000 --- a/jstests/slow2/readmajority_jscore_passthrough.js +++ /dev/null @@ -1,53 +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}; - - 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); - }; - -})(); - |