From ce2c9afb90eecd0c7b2ab1f86afae6d7cdef1572 Mon Sep 17 00:00:00 2001 From: Katherine Walker Date: Tue, 30 Jul 2019 15:32:25 -0400 Subject: [PATCH] fix(connections_stepdown_tests): use correct version of mongo for tests --- test/functional/connections_stepdown_tests.js | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/test/functional/connections_stepdown_tests.js b/test/functional/connections_stepdown_tests.js index 0c1c46d8fa..3d7b672ddb 100644 --- a/test/functional/connections_stepdown_tests.js +++ b/test/functional/connections_stepdown_tests.js @@ -118,7 +118,7 @@ describe('Connections survive primary step down', function() { }); it('Not Master - Reset Connection Pool', { - metadata: { requires: { mongodb: '<=4.0.0', topology: 'replicaset' } }, + metadata: { requires: { mongodb: '4.0.x', topology: 'replicaset' } }, test: function() { const db = client.db('step-down'); let numberOfConnections; @@ -141,29 +141,27 @@ describe('Connections survive primary step down', function() { mode: { times: 1 }, data: { failCommands: ['insert'], errorCode: 10107 } }) - .then(() => { - collection - .insertOne({ test: 1 }) - .catch(err => expect(err.code).to.equal(10107)) - .then(() => - db.executeDbAdminCommand({ configureFailPoint: 'failCommand', mode: 'off' }) + .then(() => + collection.insertOne({ test: 1 }).catch(err => expect(err.code).to.equal(10107)) + ) + .then(() => + db.executeDbAdminCommand({ configureFailPoint: 'failCommand', mode: 'off' }) + ) + .then(() => + db + .admin() + .serverStatus() + .then(result => + expect(result.connections.totalCreated).to.equal(numberOfConnections + 1) ) - .then(() => - db - .admin() - .serverStatus() - .then(result => - expect(result.connections.totalCreated).to.equal(numberOfConnections + 1) - ) - ); - }) + ) ) ); } }); it('Shutdown in progress - Reset Connection Pool', { - metadata: { requires: { topology: 'replicaset' } }, + metadata: { requires: { mongodb: '>=4.0.0', topology: 'replicaset' } }, test: function() { const db = client.db('step-down'); let numberOfConnections; @@ -206,7 +204,7 @@ describe('Connections survive primary step down', function() { }); it('Interrupted at shutdown - Reset Connection Pool', { - metadata: { requires: { topology: 'replicaset' } }, + metadata: { requires: { mongodb: '>=4.0.0', topology: 'replicaset' } }, test: function() { const db = client.db('step-down'); let numberOfConnections;