Do you want to request a _feature_ or report a _bug_?
Bug
What is the current behavior?
In the getting started example, npm test runs an infinite time w/o any output:
npm test
> @ test /Users/inyono/Projects/jest/examples/getting_started
> jest
While ./node_modules/.bin/jest --help works as intended, ./node_modules/.bin/jest --version also hangs w/o any output. Terminal says watchman is running.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.
git clone [email protected]:facebook/jest.gitcd jest/examples/getting_startednpm installnpm testWhat is the expected behavior?
As described in https://facebook.github.io/jest/docs/getting-started.html
Run Jest again with --debug and provide the full configuration it prints. Please mention your node and npm version and operating system.
npm test -- --debug resp. ./node_modules/.bin/jest --debug hang w/o any outputUnfortunately I don't have access to the new version of macOS yet. Do you have some time to help troubleshoot and potentially fix the issue? See https://github.com/facebook/jest/blob/master/CONTRIBUTING.md#worfklow-and-pull-requests for how to get started.
Can you try --no-watchman to see if this is a watchman issue?
Thanks for the quick response.
--no-watchman didn't help, Terminal still says that watchman is running. I will try to troubleshoot the issue.
It probably makes sense to console.log in this promise chain: https://github.com/facebook/jest/blob/master/packages/jest-cli/src/jest.js#L133 and see where it gets stuck.
If you are using the Jest repo itself, make sure you do npm run watch in a background tab to keep compiling your files. You can also just insert those logs into the build file of jest in your project.
Thanks for the pointers, seems to be an issue with watchman. Jest hangs here: https://github.com/facebook/jest/blob/master/packages/jest-haste-map/src/index.js#L73. This is also the case when I run watchman version directly in the terminal (no output). watchman -v works, though, and outputs 4.6.0. I installed watchman using homebrew.
Fun fact: If I uninstall watchman, jest works again 馃槃
@wez are there any known problems with watchman on macOS Sierra?
I've not had any reports of problems on macOS Sierra so far, but have not tried it for myself yet. It would be valuable to get a copy of @inyono's watchman logs. I believe that they are located in /usr/local/var/run/watchman/$USER-state/log for a homebrew install. Would be great to get that in a gist or pastebin or something.
@wez There were logs at the location you mentioned. The last entries are from a month ago using watchman v4.5.0:
2016-08-01T14:50:06,518: [listener] Watchman 4.5.0 <no build info set> starting up on Jonass-MacBook-Pro.local
2016-08-01T14:50:06,523: [listener] Using watcher mechanism fsevents
2016-08-01T14:50:06,524: [listener] file limit is 256 kern.maxfilesperproc=10240
2016-08-01T14:50:06,524: [listener] raised file limit to 10240
2016-08-01T14:50:06,524: [listener] Using socket from launchd as listening socket
Terminating due to signal 15 Terminated generated by pid=1 uid=0. (0x0)
0 watchman 0x0000000103127b0f crash_handler + 345
1 libsystem_platform.dylib 0x0000000103db7d7a _sigtramp + 26
2 ??? 0x0000000000000000 0x0 + 0
3 watchman 0x00000001031363ce run_service + 216
4 watchman 0x000000010313624a main + 2465
5 libdyld.dylib 0x0000000103a7c255 start + 1
There are no logs for watchman v4.6.0, though, even when trying to run watchman. So I suppose that watchman v4.5.0 worked fine but there is some problem with v4.6.0. I can't downgrade to the previous version using brew, unfortunately. If it helps, I can try to build v4.5.0 manually again and try if this works as intended.
It seems like this is a watchman issue because Jest works fine if watchman isn't installed. I opened an issue on the watchman bug tracker but happy to reopen here if it turns out to be a Jest issue.
Agreed. The only "issue" I see on Jest's side is that --no-watchman succeeds after the canUseWatchman check and is therefore useless when watchman version goes into an infinite loop.
This turned out to be one of the watchman shutdown issues in 4.5 that got fixed in 4.6
also: I reached out to our most active engineer currently running macOS Sierra and our watchman diagnostics ran clean. It's a small sample size, but I think we can rule out a Sierra specific issue here.
For future readers: I have seen this same issue on El Cap 10.11.6 with jest 13.2.3, but uninstalling watchman (4.7.0) seems to fix it.
@mdtusz perhaps you hit https://github.com/facebook/watchman/issues/358 instead?
I'm on Sierra, [email protected], and [email protected], and tried the things listed in here:
watchman -v: 4.7.0watchman version: hangsjest --help: prints help messagejest -v: hangs, never prints anythingjest: hangs, never prints anythingjest --no-watchman: hangs, never prints anythingAfter uninstalling watchman, jest works correctly.
I apologize if this would be better served reporting on some other issue / repo.
Had this problem again, too. https://github.com/facebook/watchman/issues/355 helped again
Most helpful comment
Fun fact: If I uninstall watchman, jest works again 馃槃