Skip to content

Conversation

@alxndrsn
Copy link

This fix for balderdashy/sails#6908 will allow mocha to be updated to the latest version.

});

after(function(done) {
manager.pool.end(done);
Copy link
Member

Choose a reason for hiding this comment

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

Should we use the mp-postgresql destroyManager method for this?

Copy link
Author

Choose a reason for hiding this comment

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

Up to you 🙂

Copy link
Author

Choose a reason for hiding this comment

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

Thinking about this more, I think the above approach is preferable to using the library under test for cleanup.

assert(report.connection.release);
// Assert that the connection has a release function, and call it to
// release the connection.
report.connection.release();
Copy link
Member

Choose a reason for hiding this comment

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

Should we keep the assert here?

Copy link
Author

Choose a reason for hiding this comment

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

Does it add value? If report.connection.release is not defined, then this line will throw anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Fair point, but I'd like to keep this PR to just the minimal set of changes needed for the fix

Copy link
Member

@rachaelshaw rachaelshaw left a comment

Choose a reason for hiding this comment

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

assert(report.connection.release);
// Assert that the connection has a release function, and call it to
// release the connection.
report.connection.release();
Copy link
Author

Choose a reason for hiding this comment

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

So your preference would be something like below?

        // Assert that the connection has a release function
        assert(report.connection.release);

        // Call the release function on the connection to release the connection
        report.connection.release();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants