balderdashy / balderdashy/sails

machinepack-postgresql may not be cleaning up properly after tests

Open
#6,908 6 comments 0 reactions 0 assignees View on GitHub
has pr orm postgresql proposal
Dominant language
JavaScript
Stars
22.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

`machinepack-postgresql` [uses mochajs `3.0.2`](https://github.com/sailshq/machinepack-postgresql/blob/master/package.json#L33) which is [over 3 years old](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#302--2016-08-08).

When upgraded to the latest version of `mocha`, mocha does not exit at the end of the test run. This can be fixed by adding the `--exit` flag to the `mocha` call, suggesting it is caused by the breaking change in mocha v4 (September 2017) such that:
> If the mocha process is still alive after your tests seem "done", then your tests have scheduled something to happen (asynchronously) and _haven't cleaned up after themselves properly_. Did you leave a socket open?
> --_https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit_

Contributor guide

Open the contributing guide

Research direction

Start with the machinepack-postgresql package.json and its Mocha test command, then review the tests for asynchronous resources that remain open after completion. Reproduce the non-exiting test run with a current Mocha version and identify the cleanup that is missing. Done means the tests exit normally without relying on the --exit flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, postgresql
Domain
databases, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.