Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Investigate why jest exits immediately, since a socket pool is created #7

Closed
rauchg opened this issue Nov 4, 2017 · 5 comments
Closed

Comments

@rauchg
Copy link
Member

rauchg commented Nov 4, 2017

I don't know why jest is so fast at quitting if sockets should be remaining open with the introduction of agentkeepalive

@Qix-
Copy link
Contributor

Qix- commented Nov 4, 2017

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

@TooTallNate
Copy link
Member

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-
Copy link
Contributor

Qix- commented Nov 9, 2017

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-
Copy link
Contributor

Qix- commented Feb 11, 2022

@styfle Looks like a mistake, 32d78b4 is just a license update entirely unrelated to this issue.

@styfle styfle reopened this Feb 11, 2022
@Ethan-Arrowood
Copy link
Contributor

Thank you for the report. We are archiving this project; you can read more details here: #83

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants