Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning "Jest did not exit one second after the test run has completed" out on Node v20 #223

Open
ti2sugiyama opened this issue Nov 22, 2023 · 1 comment

Comments

@ti2sugiyama
Copy link

ti2sugiyama commented Nov 22, 2023

Hi, I'm getting the warning "Jest did not exit one second after the test run has completed", not always but only when I run a short run time test(maybe less than 60sec? or 30sec?).

I found a ChangeLog that may be related to this issue. it's about "keep HTTP/1.1 conns alive".

and I tested to add "connection":"close" header to the wait-for-localhost.ts file and no more warning out.

https://github.com/shelfio/jest-dynamodb/blob/v3.4.2/src/utils/wait-for-localhost.ts#L14C9-L14C48

{headers:{'connection': 'close'}, method: 'GET', port, host, path: '/'},

Can I set header options? or is there a workaround?

Package Versions

"@shelf/jest-dynamodb": "^3.4.2",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
@SuperFun99
Copy link

You can also add response.resume() or response.destroy() at the top of the response callback in wait-for-localhost. Unfortunately I couldn't find a better workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants