diff options
author | William Schultz <william.schultz@mongodb.com> | 2018-09-17 13:15:26 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2018-09-24 11:15:41 -0400 |
commit | 22296574a08f69f32c9b916cf2e2b1df8b6160e3 (patch) | |
tree | 68cd6833d053c959d8473172aae486586f970502 | |
parent | 5099801229722b5d25dfaa20a675905353b9681e (diff) | |
download | mongo-22296574a08f69f32c9b916cf2e2b1df8b6160e3.tar.gz |
SERVER-37152 Increase write concern timeouts for writes expected to succeed in tags.js
(cherry picked from commit 17af0c46faacd8bcd7dd99cfc668011e7911e18c)
-rw-r--r-- | jstests/replsets/libs/tags.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/jstests/replsets/libs/tags.js b/jstests/replsets/libs/tags.js index 0b61c990c49..f91484e0296 100644 --- a/jstests/replsets/libs/tags.js +++ b/jstests/replsets/libs/tags.js @@ -200,13 +200,13 @@ var TagsTest = function(options) { // Depending on the order of heartbeats (containing last committed op time) received // by a node, it might hang up on its sync source. This may cause some of the write concern // tests to fail. - var timeout = 20 * 1000; + var failTimeout = 15 * 1000; jsTestLog('test1'); primary = ensurePrimary(2, replTest.nodes.slice(0, 3)); jsTestLog('Non-existent write concern should be rejected.'); - options = {writeConcern: {w: 'blahblah', wtimeout: timeout}}; + options = {writeConcern: {w: 'blahblah', wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); var result = assert.writeError(primary.getDB('foo').bar.insert(doc, options)); assert.neq(null, result.getWriteConcernError()); @@ -215,7 +215,7 @@ var TagsTest = function(options) { tojson(result.getWriteConcernError())); jsTestLog('Write concern "3 or 4" should fail - 3 and 4 are not connected to the primary.'); - var options = {writeConcern: {w: '3 or 4', wtimeout: timeout}}; + var options = {writeConcern: {w: '3 or 4', wtimeout: failTimeout}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); result = primary.getDB('foo').bar.insert(doc, options); assert.neq(null, result.getWriteConcernError()); @@ -228,12 +228,12 @@ var TagsTest = function(options) { jsTestLog('Write concern "3 or 4" should work - 4 is now connected to the primary ' + primary.host + ' via node 1 ' + replTest.nodes[1].host); - options = {writeConcern: {w: '3 or 4', wtimeout: timeout}}; + options = {writeConcern: {w: '3 or 4', wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); assert.writeOK(primary.getDB('foo').bar.insert(doc, options)); jsTestLog('Write concern "3 and 4" should fail - 3 is not connected to the primary.'); - options = {writeConcern: {w: '3 and 4', wtimeout: timeout}}; + options = {writeConcern: {w: '3 and 4', wtimeout: failTimeout}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); result = assert.writeError(primary.getDB('foo').bar.insert(doc, options)); assert.neq(null, result.getWriteConcernError()); @@ -247,7 +247,7 @@ var TagsTest = function(options) { jsTestLog('Write concern "3 and 4" should work - ' + 'nodes 3 and 4 are connected to primary via node 1.'); - options = {writeConcern: {w: '3 and 4', wtimeout: timeout}}; + options = {writeConcern: {w: '3 and 4', wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); assert.writeOK(primary.getDB('foo').bar.insert(doc, options)); @@ -263,7 +263,7 @@ var TagsTest = function(options) { jsTestLog('Write concern "2 dc and 3 server"'); primary = ensurePrimary(2, replTest.nodes.slice(0, 3), replTest.nodes.length); - options = {writeConcern: {w: '2 dc and 3 server', wtimeout: timeout}}; + options = {writeConcern: {w: '2 dc and 3 server', wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); assert.writeOK(primary.getDB('foo').bar.insert(doc, options)); @@ -284,13 +284,13 @@ var TagsTest = function(options) { jsTestLog('Write concern "3 and 4" should still work with new primary node 1 ' + primary.host); - options = {writeConcern: {w: '3 and 4', wtimeout: timeout}}; + options = {writeConcern: {w: '3 and 4', wtimeout: ReplSetTest.kDefaultTimeoutMS}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); assert.writeOK(primary.getDB('foo').bar.insert(doc, options)); jsTestLog('Write concern "2" should fail because node 2 ' + replTest.nodes[2].host + ' is down.'); - options = {writeConcern: {w: '2', wtimeout: timeout}}; + options = {writeConcern: {w: '2', wtimeout: failTimeout}}; assert.writeOK(primary.getDB('foo').bar.insert(doc)); result = assert.writeError(primary.getDB('foo').bar.insert(doc, options)); assert.neq(null, result.getWriteConcernError()); |