Skip to content

Commit 47e519f

Browse files
committed
some fixes for proxy tests to attempt to avoid travis running issues
1 parent 671f286 commit 47e519f

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

test/functional/replicaset_mock_tests.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ exports['Should correctly print warning when non mongos proxy passed in seed lis
108108
db.close();
109109
mongos1.destroy();
110110
mongos2.destroy();
111-
test.done();
111+
112+
setTimeout(function(){
113+
test.done();
114+
}, 200);
112115
});
113116
});
114117
}
@@ -162,8 +165,8 @@ exports['Should correctly print warning and error when no mongos proxies in seed
162165

163166
// Boot the mock
164167
co(function*() {
165-
mongos1 = yield mockupdb.createServer(52000, 'localhost');
166-
mongos2 = yield mockupdb.createServer(52001, 'localhost');
168+
mongos1 = yield mockupdb.createServer(52002, 'localhost');
169+
mongos2 = yield mockupdb.createServer(52003, 'localhost');
167170

168171
// Mongos
169172
co(function*() {
@@ -203,12 +206,12 @@ exports['Should correctly print warning and error when no mongos proxies in seed
203206
warnings.push(state);
204207
});
205208

206-
MongoClient.connect('mongodb://localhost:52000,localhost:52001/test', function(err, db) {
209+
MongoClient.connect('mongodb://localhost:52002,localhost:52003/test', function(err, db) {
207210
Logger.setCurrentLogger(logger);
208211

209212
// Assert all warnings
210-
test.equal('expected mongos proxy, but found replicaset member mongod for server localhost:52000', warnings[0].message);
211-
test.equal('expected mongos proxy, but found replicaset member mongod for server localhost:52001', warnings[1].message);
213+
test.equal('expected mongos proxy, but found replicaset member mongod for server localhost:52002', warnings[0].message);
214+
test.equal('expected mongos proxy, but found replicaset member mongod for server localhost:52003', warnings[1].message);
212215
test.equal('no mongos proxies found in seed list, did you mean to connect to a replicaset', warnings[2].message);
213216
test.equal('seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name', warnings[3].message);
214217
// Assert error
@@ -217,7 +220,9 @@ exports['Should correctly print warning and error when no mongos proxies in seed
217220
running = false;
218221
mongos1.destroy();
219222
mongos2.destroy();
220-
test.done();
223+
setTimeout(function(){
224+
test.done();
225+
}, 200);
221226
});
222227
});
223228
}
@@ -269,8 +274,8 @@ exports['Should correctly set socketTimeoutMS and connectTimeoutMS for mongos']
269274
var command = null;
270275
// Boot the mock
271276
co(function*() {
272-
mongos1 = yield mockupdb.createServer(52000, 'localhost');
273-
mongos2 = yield mockupdb.createServer(52001, 'localhost');
277+
mongos1 = yield mockupdb.createServer(52004, 'localhost');
278+
mongos2 = yield mockupdb.createServer(52005, 'localhost');
274279

275280
// Mongos
276281
co(function*() {
@@ -300,7 +305,7 @@ exports['Should correctly set socketTimeoutMS and connectTimeoutMS for mongos']
300305
}
301306
});
302307

303-
MongoClient.connect('mongodb://localhost:52000,localhost:52001/test?socketTimeoutMS=120000&connectTimeoutMS=15000', function(err, db) {
308+
MongoClient.connect('mongodb://localhost:52004,localhost:52005/test?socketTimeoutMS=120000&connectTimeoutMS=15000', function(err, db) {
304309
test.equal(null, err);
305310
test.equal(15000, db.serverConfig.s.mongos.s.options.connectionTimeout);
306311
test.equal(120000, db.serverConfig.s.mongos.s.options.socketTimeout);
@@ -309,7 +314,10 @@ exports['Should correctly set socketTimeoutMS and connectTimeoutMS for mongos']
309314
mongos1.destroy();
310315
mongos2.destroy();
311316
running = false;
312-
test.done();
317+
318+
setTimeout(function(){
319+
test.done();
320+
}, 200);
313321
});
314322
});
315323
}

0 commit comments

Comments
 (0)