diff --git a/lib/core/sdam/srv_polling.js b/lib/core/sdam/srv_polling.js index 115ae45caf..2c0b6ee2ef 100644 --- a/lib/core/sdam/srv_polling.js +++ b/lib/core/sdam/srv_polling.js @@ -59,7 +59,7 @@ class SrvPoller extends EventEmitter { } get intervalMS() { - return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMs; + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; } start() { diff --git a/test/unit/sdam/srv_polling.test.js b/test/unit/sdam/srv_polling.test.js index 2461a39b97..5c06712177 100644 --- a/test/unit/sdam/srv_polling.test.js +++ b/test/unit/sdam/srv_polling.test.js @@ -69,6 +69,13 @@ describe('Mongos SRV Polling', function() { context.sinon.stub(poller, 'parentDomainMismatch'); } + it('should always return a valid value for `intervalMS`', function() { + const poller = new SrvPoller({ srvHost: SRV_HOST }); + expect(poller) + .property('intervalMS') + .to.equal(60000); + }); + describe('success', function() { it('should emit event, disable haMode, and schedule another poll', function(done) { const records = [srvRecord('jalad.tanagra.com'), srvRecord('thebeast.tanagra.com')];