vercel/fetch

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

Qix- commented

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).

Qix- commented

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

Qix- commented

@styfle Looks like a mistake, 32d78b4 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: #83