Skip to content

Commit b55176b

Browse files
committed
Added test ensuring uri socketTimeoutMS and connectTimeoutMS passed down correctly
1 parent 28da548 commit b55176b

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

test/functional/mongo_client_tests.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,6 @@ exports['Should correctly pass through extra sharded options'] = {
245245
}
246246
}
247247
}, function(err, db) {
248-
console.log("============================================")
249-
console.dir(err)
250-
console.dir(db.s.topology.s.clonedOptions)
251-
252248
test.equal(false, db.s.topology.s.clonedOptions.ha);
253249
test.equal(10000, db.s.topology.s.clonedOptions.haInterval);
254250
test.equal(100, db.s.topology.s.clonedOptions.localThresholdMS);
@@ -631,3 +627,28 @@ exports['Should correctly pass through socketTimeoutMS and connectTimeoutMS'] =
631627
});
632628
}
633629
}
630+
631+
exports['Should correctly pass through socketTimeoutMS and connectTimeoutMS from uri'] = {
632+
metadata: {
633+
requires: {
634+
node: ">0.8.0",
635+
topology: ['single']
636+
}
637+
},
638+
639+
// The actual test we wish to run
640+
test: function(configuration, test) {
641+
var MongoClient = configuration.require.MongoClient;
642+
var uri = f("%s?socketTimeoutMS=120000&connectTimeoutMS=15000", configuration.url());
643+
644+
MongoClient.connect(uri, {
645+
}, function(err, db) {
646+
test.equal(null, err);
647+
test.equal(120000, db.serverConfig.s.server.s.options.socketTimeout);
648+
test.equal(15000, db.serverConfig.s.server.s.options.connectionTimeout);
649+
650+
db.close();
651+
test.done();
652+
});
653+
}
654+
}

0 commit comments

Comments
 (0)