-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Change socket timeout default to 0 [PORT] #2572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
it('should default socketTimeout to infinity', function(done) { | ||
const client = new MongoClient(this.configuration.url()); | ||
client.connect(() => { | ||
expect(client.s.options.socketTimeoutMS).to.deep.equal(0); | ||
for (const connection of client.topology.s.coreTopology.connections()) { | ||
expect(connection.socketTimeout).to.deep.equal(0); | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbroadst I saw your comment about missing testing on the 4.0 version of this, added a test here that I'll also add to 4.0 if this is all good ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
it('should default socketTimeout to infinity', function(done) { | ||
const client = new MongoClient(this.configuration.url()); | ||
client.connect(() => { | ||
expect(client.s.options.socketTimeoutMS).to.deep.equal(0); | ||
for (const connection of client.topology.s.coreTopology.connections()) { | ||
expect(connection.socketTimeout).to.deep.equal(0); | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
4c2af4e
to
5cef410
Compare
@@ -799,7 +799,7 @@ describe('Collection', function() { | |||
|
|||
db.listCollections().toArray((err, documents) => { | |||
expect(err).to.not.exist; | |||
expect(documents.length > 1).to.be.true; | |||
expect(documents.length >= 1).to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails if you run it in isolation, it depends upon other tests to create multiple collections when it only creates one itself.
Socket timeout by default is infinity. NODE-2835
5e3fc3c
to
a0d94cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Socket timeout by default is infinity.
NODE-2835