process beforeExit event not called
See original GitHub issue🐛 Bug Report
beforeExit
event is never called.
We are using this event to release resources of a Rust library upon object’s garbage collection, using https://github.com/node-ffi-napi/weak-napi.
To Reproduce
process.on('beforeExit', () => {
console.log('beforeExit')
})
describe('mytest', () => {
it('should do stuff', () => {
console.log('hey')
})
})
Expected behavior
We should see beforeExit
logged.
The same test works fine with Mocha, where beforeExit
is successfully called.
envinfo
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 12.19.1 - ~/.nvm/versions/node/v12.19.1/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.19.1/bin/npm
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:7
Top Results From Across the Web
SIGINT, beforeExit and exit event handlers not called for ctrl-c ...
I'm asking because the order each process in the pipeline receives SIGINT is uncertain. I suspect the issue here is that tee dies...
Read more >Process | Node.js v19.3.0 Documentation
The 'beforeExit' event is not emitted for conditions causing explicit termination, such as calling process.exit() or uncaught exceptions. The 'beforeExit' ...
Read more >Node.js – Process beforeExit Event - Tutorialspoint
Node.js – Process beforeExit Event - The 'beforeExit' event is called when Node.js empties its event loop and has no other work to...
Read more >process
The 'beforeExit' event is not emitted for conditions causing explicit termination, such as calling process.exit() or uncaught exceptions. The ' ...
Read more >Node.js Process beforeExit Event - GeeksforGeeks
Parameters: This event does not accept any argument as the parameter. Return Value: This event returns nothing but a callback function for ...
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
As part of my other bug report I went ahead and added a reproduction for this bug as well since they might be related? https://github.com/cowboyd/jest-suite-hooks-on-sigint
Strong agree. Hopefully with Facebook setting this project free this will get some attention.