summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2018-10-01 12:34:53 -0400
committerWilliam Schultz <william.schultz@mongodb.com>2019-02-11 09:15:33 -0500
commit6b7bbd4b42268c07b6c9145bc26e02c792863d88 (patch)
tree19c6707bf19c519c300d398464ee88944a61c527
parenta79ff87dbdffd86e84da2703a256d56499d72cd2 (diff)
downloadmongo-6b7bbd4b42268c07b6c9145bc26e02c792863d88.tar.gz
SERVER-37274 Set priority of secondaries to zero in commands_that_accept_write_concern JS tests
(cherry picked from commit f4c69235c352f846461c5ec11d11338114f5f3a7)
-rw-r--r--jstests/replsets/commands_that_write_accept_wc.js7
-rw-r--r--jstests/sharding/commands_that_write_accept_wc_configRS.js11
-rw-r--r--jstests/sharding/commands_that_write_accept_wc_shards.js11
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 284c9143a7e..26d785c97f7 100644
--- a/jstests/replsets/commands_that_write_accept_wc.js
+++ b/jstests/replsets/commands_that_write_accept_wc.js
@@ -8,7 +8,12 @@
(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 ba2f3f559c6..0cbc7d18210 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 37d95c3c189..a78c4d05c55 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,