diff options
author | William Schultz <william.schultz@mongodb.com> | 2018-10-01 12:34:53 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2019-02-11 12:16:13 -0500 |
commit | 1760b0f15343050158742ecbc1ab6ece9e75b5d9 (patch) | |
tree | f2fd83794093949e0097ae9dc2caf97ff9aef64b | |
parent | d08d1e6cc029fb49b0bc137011750f7fe773e841 (diff) | |
download | mongo-1760b0f15343050158742ecbc1ab6ece9e75b5d9.tar.gz |
SERVER-37274 Set priority of secondaries to zero in commands_that_accept_write_concern JS tests
(cherry picked from commit f4c69235c352f846461c5ec11d11338114f5f3a7)
3 files changed, 24 insertions, 5 deletions
diff --git a/jstests/replsets/commands_that_write_accept_wc.js b/jstests/replsets/commands_that_write_accept_wc.js index b2dd90d2886..7b1d04e1631 100644 --- a/jstests/replsets/commands_that_write_accept_wc.js +++ b/jstests/replsets/commands_that_write_accept_wc.js @@ -10,7 +10,12 @@ load('jstests/libs/write_concern_util.js'); (function() { "use strict"; - var replTest = new ReplSetTest({name: 'WCSet', nodes: 3, settings: {chainingAllowed: false}}); + var replTest = new ReplSetTest({ + name: 'WCSet', + // Set priority of secondaries to zero to prevent spurious elections. + nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}], + settings: {chainingAllowed: false} + }); replTest.startSet(); replTest.initiate(); diff --git a/jstests/sharding/commands_that_write_accept_wc_configRS.js b/jstests/sharding/commands_that_write_accept_wc_configRS.js index ea864435604..de1f5e353b0 100644 --- a/jstests/sharding/commands_that_write_accept_wc_configRS.js +++ b/jstests/sharding/commands_that_write_accept_wc_configRS.js @@ -22,9 +22,16 @@ load('jstests/multiVersion/libs/auth_helpers.js'); TestData.disableImplicitSessions = true; var st = new ShardingTest({ + // Set priority of secondaries to zero to prevent spurious elections. shards: { - rs0: {nodes: 3, settings: {chainingAllowed: false}}, - rs1: {nodes: 3, settings: {chainingAllowed: false}} + rs0: { + nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}], + settings: {chainingAllowed: false} + }, + rs1: { + nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}], + settings: {chainingAllowed: false} + } }, configReplSetTestOptions: {settings: {chainingAllowed: false}}, mongos: 1 diff --git a/jstests/sharding/commands_that_write_accept_wc_shards.js b/jstests/sharding/commands_that_write_accept_wc_shards.js index 5dc01f69905..a5e6895851a 100644 --- a/jstests/sharding/commands_that_write_accept_wc_shards.js +++ b/jstests/sharding/commands_that_write_accept_wc_shards.js @@ -15,9 +15,16 @@ load('jstests/libs/write_concern_util.js'); (function() { "use strict"; var st = new ShardingTest({ + // Set priority of secondaries to zero to prevent spurious elections. shards: { - rs0: {nodes: 3, settings: {chainingAllowed: false}}, - rs1: {nodes: 3, settings: {chainingAllowed: false}} + rs0: { + nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}], + settings: {chainingAllowed: false} + }, + rs1: { + nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}], + settings: {chainingAllowed: false} + } }, configReplSetTestOptions: {settings: {chainingAllowed: false}}, mongos: 1, |