Skip to content

Commit ce2c9af

Browse files
kvwalkerdaprahamian
authored andcommitted
fix(connections_stepdown_tests): use correct version of mongo for tests
1 parent 89d94ad commit ce2c9af

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

test/functional/connections_stepdown_tests.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe('Connections survive primary step down', function() {
118118
});
119119

120120
it('Not Master - Reset Connection Pool', {
121-
metadata: { requires: { mongodb: '<=4.0.0', topology: 'replicaset' } },
121+
metadata: { requires: { mongodb: '4.0.x', topology: 'replicaset' } },
122122
test: function() {
123123
const db = client.db('step-down');
124124
let numberOfConnections;
@@ -141,29 +141,27 @@ describe('Connections survive primary step down', function() {
141141
mode: { times: 1 },
142142
data: { failCommands: ['insert'], errorCode: 10107 }
143143
})
144-
.then(() => {
145-
collection
146-
.insertOne({ test: 1 })
147-
.catch(err => expect(err.code).to.equal(10107))
148-
.then(() =>
149-
db.executeDbAdminCommand({ configureFailPoint: 'failCommand', mode: 'off' })
144+
.then(() =>
145+
collection.insertOne({ test: 1 }).catch(err => expect(err.code).to.equal(10107))
146+
)
147+
.then(() =>
148+
db.executeDbAdminCommand({ configureFailPoint: 'failCommand', mode: 'off' })
149+
)
150+
.then(() =>
151+
db
152+
.admin()
153+
.serverStatus()
154+
.then(result =>
155+
expect(result.connections.totalCreated).to.equal(numberOfConnections + 1)
150156
)
151-
.then(() =>
152-
db
153-
.admin()
154-
.serverStatus()
155-
.then(result =>
156-
expect(result.connections.totalCreated).to.equal(numberOfConnections + 1)
157-
)
158-
);
159-
})
157+
)
160158
)
161159
);
162160
}
163161
});
164162

165163
it('Shutdown in progress - Reset Connection Pool', {
166-
metadata: { requires: { topology: 'replicaset' } },
164+
metadata: { requires: { mongodb: '>=4.0.0', topology: 'replicaset' } },
167165
test: function() {
168166
const db = client.db('step-down');
169167
let numberOfConnections;
@@ -206,7 +204,7 @@ describe('Connections survive primary step down', function() {
206204
});
207205

208206
it('Interrupted at shutdown - Reset Connection Pool', {
209-
metadata: { requires: { topology: 'replicaset' } },
207+
metadata: { requires: { mongodb: '>=4.0.0', topology: 'replicaset' } },
210208
test: function() {
211209
const db = client.db('step-down');
212210
let numberOfConnections;

0 commit comments

Comments
 (0)