-
Notifications
You must be signed in to change notification settings - Fork 38
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
Running Jest now hangs on "Determining test suites to run..." #194
Comments
On my local machine, it seems to be getting stuck in a loop on I have tried setting a new hostname and clientConfig endpoint, but no joy. Here is the error from
|
I have the issue except that it's working fine on localhost (windows) and it hangs on starting when running in github actions (Ubuntu) if the node version is 18. If I downgrade the version to 16 or 14, it's working fine on localhost as well as on github actions. What's your node version and os? |
@C4n4rd0 hmm I'll have to check, but I think im on v19 locally and have been for some time. But my lambdas mostly run on 16 and 18. I'll try using 16 locally. My github actions use 16. |
I think I found a workaround. In jest-dynamodb-config.js, in the return statement, I added hostname: '127.0.0.1' and now my tests pass successfully. |
@C4n4rd0 I tried this, but it didn't work for me. It's still hanging.
|
I have just confirmed that everything works fine on Node 16. Node 18+ and it hangs. |
That's strange. Take a look at this: node-fetch/node-fetch#1624 It seems like they have the same issue. |
Finally, I removed what I told you to do previously with 127.0.0.1. I fixed the issue by adding dns.setDefaultResultOrder('ipv4first') at the beginning of my jest preset. |
@C4n4rd0 which file is thay exactly? |
Take a look at this page: https://github.com/cjuega/jest-s3 The section "Using with other jest presets". You have to add a file named "jest-preset.js". This will be the file you have to put as preset ans it's in this file I've put the code relates to dns. You also have to add 2 files (jest-globalSetup-mix.js and jest-globalTeardown-mix.js) as in the example. The only différence, ils that you only need dynamodb. So you can remove all the code related to s3 |
I'm having the same issue with GitHub Actions. Though Jest is just silent. After printing I tried to setup described by @C4n4rd0, but did not manage to get it working though. Can you pass examples of your configs? |
I read ther might be issues with this max-worker option. An other possibility is to add the option --dns-result-order=ipv4first. |
adding to jest-dynamodb-config.js "hostname": "127.0.0.1" in module.exports fixed my issue.
|
based on comments of the const dns = require('dns')
dns.setDefaultResultOrder('ipv4first') using |
From my point or view, it's clearly the best solution. In Node 16, the default value was ipv4first. From Node 18, the default value is verbatim. This is why we all have this issue. |
Thanks for the solution @C4n4rd0, this does not hang the test runner but I'm getting a timeout error, seems like it can't connect to the DB. Any suggestions for this config file? const dns = require('dns');
dns.setDefaultResultOrder('ipv4first');
module.exports = {
hostname: '127.0.0.1',
port: 8070,
tables: [
... |
Can you copy/paste ypur serverless configuration ? |
I'm not using the serverless framework for deployment, it's a simple lambda function talking to DynamoDB. I've tried changing the port and changing the hostname to |
All of a sudden, when trying to run my tests locally, Jest is hanging.
A java process is started on the port I configured, 8000, but it's just taking forever to do anything, in fact on my machine I've simply given up so far.
The same code is ran on Github Actions and that completed in under 30 seconds for all my tests.
The text was updated successfully, but these errors were encountered: