Sequelize with postgres leaves jest hanging after all tests executed
See original GitHub issueHello, I have made a sscee for this issue:
- clone the following repo: https://github.com/LaurentVB/sequelize-hanging-test
npm install
- setup an empty postgresql DB named ‘test’, accessible by ‘root’ without password
npm test
What do you expect to happen?
The test executes and the prompt returns.
What is actually happening?
After all tests pass, the execution of jest hangs until it’s killed with CTRL+C. The same test with an embedded in-memory sqlite DB behaves as expected.
Dialect: postgres Sequelize version: 3.24.6
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Jest - "Cannot log after tests are done." Having problems on ...
I have no idea why the test runner is getting hung up from file imports. Any ideas? node.js · jestjs · sequelize.js ·...
Read more >Why Jest freezes after tests run? (Jest hangs indefinitely)
If you noticed that Jest (npm / yarn) test hang at the end of the test execution while you run tests in parallel...
Read more >Jest tests hang due to open Sequelize connections-sequelize.js
This means it is possible to leverage Jest's afterAll to close the sequelize connection pool without having to manually include it in every...
Read more >Jest Test Of Function That Contain An Async Call To User ...
After all tests pass the execution of jest hangs until it's killed with CTRL+C. The same test with an embedded inmemory sqlite DB...
Read more >How to use 'sequelize.sync()' without difficulties - Medium
Because the changes in those migration files are already applied to the database when 'sync' is run. 'sync()' command finds any changes in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is not working anymore. Using latest version of jest and sequelize, jest still hangs after calling sequelize.close()
Hmm yeah, I see that behaviour as well - I’ve never seen it happen in mocha tests, so it must be something jest is doing 😃
Adding
works fine though