fetch
fetch copied to clipboard
Investigate why `jest` exits immediately, since a socket pool is created
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
@styfle Looks like a mistake, https://github.com/vercel/fetch/commit/32d78b48401e9729a37f38dfb0af97d3f7384e38 is just a license update entirely unrelated to this issue.
Thank you for the report. We are archiving this project; you can read more details here: https://github.com/vercel/fetch/issues/83