Skip to content

Conversation

@nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Oct 9, 2020

Socket timeout by default is infinity.

NODE-2835

@nbbeeken nbbeeken requested review from emadum, mbroadst and reggi October 9, 2020 17:14
Copy link
Contributor

@reggi reggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 100 to 112
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();
});
});

Copy link
Contributor Author

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 ✅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 100 to 112
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();
});
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nbbeeken nbbeeken force-pushed the NODE-2835/remove-default-read-timeout branch from 4c2af4e to 5cef410 Compare November 2, 2020 15:47
db.listCollections().toArray((err, documents) => {
expect(err).to.not.exist;
expect(documents.length > 1).to.be.true;
expect(documents.length >= 1).to.be.true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what changed here?

Copy link
Contributor Author

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.

@nbbeeken nbbeeken force-pushed the NODE-2835/remove-default-read-timeout branch from 5e3fc3c to a0d94cc Compare November 5, 2020 18:51
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbroadst mbroadst merged commit 89b77ed into 3.6 Nov 6, 2020
@mbroadst mbroadst deleted the NODE-2835/remove-default-read-timeout branch November 6, 2020 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants