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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest hangs on last test suite constantly #6740

Closed
RajaJaganathan opened this issue Jul 23, 2018 · 5 comments
Closed

Jest hangs on last test suite constantly #6740

RajaJaganathan opened this issue Jul 23, 2018 · 5 comments

Comments

@RajaJaganathan
Copy link

RajaJaganathan commented Jul 23, 2018

馃悰 Bug Report

Jest is hanging constantly on last test suite runs. Every time the last test suite is different. I have tried with runInBand options but no luck.

screen shot 2018-07-23 at 10 42 47 am

screen shot 2018-07-23 at 10 43 31 am

I got some luck after running node_modules/.bin/jest --clearCache then node_modules/.bin/jest
now works mostly. But still, it's not stable enough.

"scripts": { "test": "jest --clearCache && jest --silent" }

I have installed watchman via homebrew also as pointed out on other issues but no luck. Could please help us to fix the issue. Please let me know if any information is needed.

Environment Information:

System:
      OS: macOS Sierra 10.12.6
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
      Node: 6.11.1 - ~/.nvm/versions/node/v6.11.1/bin/node
      npm: 5.3.0 - ~/.nvm/versions/node/v6.11.1/bin/npm
  npmPackages:
      jest: ^23.4.1 => 23.4.1

Thanks!

@SimenB
Copy link
Member

SimenB commented Jul 26, 2018

Without a reproduction this is not actionable for us. Happy to reopen if one is provided.

@SimenB SimenB closed this as completed Jul 26, 2018
@laumair
Copy link

laumair commented Dec 12, 2018

Facing the same issue. @RajaJaganathan Were you able to resolve it?

@RajaJaganathan
Copy link
Author

RajaJaganathan commented Dec 12, 2018

@laumair There is no issue with jest, I have fixed this issue by modifing my tests code. I faced this issue when I migrated from mocha to jest. One notable issue is that we need to call 'done' callback properly if test is asynchronous.

For example, Test might completed before our asynchronous function call gets completed. Those asynchronous call might be the problem.

@mindplay-dk
Copy link

I have a completely trivial test like the following:

test('something', async () => {
  let value = await something();
  expect(value).toBe(true)
})

Even if I explicitly finish the test with done, it just spins forever:

test('something', async (done) => {
  let value = await something();
  expect(value).toBe(true)
  done()
})

Most likely because something() never resolves - but the test never times out, so my only option is CTRL+C, which doesn't tell me where it was or what it was doing.

Why doesn't it respect the timeout?

How do you diagnose something like this?

@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 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants