Investigate why `jest` exits immediately, since a socket pool is created
rauchg opened this issue · 5 comments
I don't know why jest
is so fast at quitting if sockets should be remaining open with the introduction of agentkeepalive
Just had this problem the other day - it was an async/await issue. May be unrelated, but I remember wondering the same thing.
Let's make sure we're using promises correctly and not missing some async keyword or something
It's possible to call socket.deref()
or something like that as well to have an open socket that doesn't keep the event loop running. Perhaps they're using that feature (I believe that the built-in HTTP agent does this).
The solution I've used in the past is a timeout promise that either times out and rejects, or otherwise allows you to mark something as resolved by exposing the resolver function.
I've noticed this be a problem with the async function main(argv) { return 0; }
approach, cc @rauchg
Thank you for the report. We are archiving this project; you can read more details here: #83