Skip to content

Commit

Permalink
fix(connections_stepdown_tests): use correct version of mongo for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kvwalker authored and daprahamian committed Aug 13, 2019
1 parent 89d94ad commit ce2c9af
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions test/functional/connections_stepdown_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ce2c9af

Please sign in to comment.