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

Jest freezing after tests run in Node 11 #7282

Closed
jcubic opened this issue Oct 26, 2018 · 7 comments
Closed

Jest freezing after tests run in Node 11 #7282

jcubic opened this issue Oct 26, 2018 · 7 comments

Comments

@jcubic
Copy link

jcubic commented Oct 26, 2018

🐛 Bug Report

I have normal quite big test file that work fine in node 10 but is freezing in 11 after printing:

Ran all test suites.

From what I've checked all my setTimeouts return a promises or have async done() call.

Found this in Travis here is link to broken build:
https://travis-ci.org/jcubic/jquery.terminal/builds/445853587

To Reproduce

on Node 11:

git clone https://github.com/jcubic/jquery.terminal.git
cd jquery.terminal
npm install
make test

make test is running this command:

JEST=./node_modules/.bin/jest
test:
	$(JEST) --coverage --testMatch '**/__tests__/*.spec.js'

no config file

Expected behavior

test finish and script exits

Link to repl or repo (highly encouraged)

Will try to make smaller repro

Run npx envinfo --preset jest

npx: zainstalowano 1 w 1.564s

  System:
    OS: Linux 4.18 Fedora 27 (Twenty Seven) 27 (Twenty Seven)
    CPU: x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 11.0.0 - ~/.nvm/versions/node/v11.0.0/bin/node
    Yarn: 1.10.1 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v11.0.0/bin/npm
  npmPackages:
    jest: ^23.6.0 => 23.6.0 
@SimenB
Copy link
Member

SimenB commented Oct 26, 2018

I get the same hanging, but a reduced example would be great 🙂

@jcubic
Copy link
Author

jcubic commented Oct 27, 2018

After disable some test I've found issue in this snippet in my code (not test file):

var x = next.offset().top - 50;
$('html,body').animate({scrollTop: x}, 500);

x was NaN but I've got the same result when I have 0 instead of x, the problem is that this one line If I comment it out and run full test it still freezing, I have limited number of tests (one fdescribe and few xdescribe inside) and toggling this line fix the problem. So maybe there are more issues with Node 11. Will keep try to find other issues and keep you posted.

@jcubic
Copy link
Author

jcubic commented Oct 28, 2018

I've also found issue with attr('scrollTop') and .scrollTop() functions but the problem may be somewhere in setTimeout function in Node 11 because I've run jest in debug mode and when I paused in debugger I got timers.js file, I've reported the issue to Node will see what they have to say about this issue.

@jcubic
Copy link
Author

jcubic commented Oct 28, 2018

@SimenB do you use setTimeout in your code that's freezing?

@jcubic
Copy link
Author

jcubic commented Oct 28, 2018

The issues seems resolved and the fix will be in Node v11.1.0, I would keep this open until it's fixed upstream or you can close if you think it would be better, but someone may report same issue.

@SimenB
Copy link
Member

SimenB commented Oct 28, 2018

@jcubic I meant that your reproduction also froze for me, I don't have any separate project showing the same error.

If it's a bug in node slated for a release, I'll close this. If it actually is jest's fault somehow, happy to reopen 🙂

@SimenB SimenB closed this as completed Oct 28, 2018
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
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

2 participants