x)- [x ] bug report -> please search issues before submitting
- [ ] feature request
x)- [ ] new
- [ ] build
- [ ] serve
- [x ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
OS: macOs Mojave 10.14 (18A391)
Angular CLI: 7.0.3
Node: 11.0.0
OS: darwin x64
Angular: 7.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.3
@angular-devkit/build-angular 0.10.3
@angular-devkit/build-optimizer 0.10.3
@angular-devkit/build-webpack 0.10.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@angular/cdk 7.0.2
@angular/cli 7.0.3
@angular/flex-layout 7.0.0-beta.19
@angular/material 7.0.2
@ngtools/webpack 7.0.3
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1
I have been able to reproduce this both with an existing project and a brand new project scaffolded with ng new and no changes made to the code. In mac os Terminal
ng test (no --watch option)ctrl+c to exit, the browser window used to run the tests exit but the ng test process hangs and you must force exit it in Terminal
As far as I can tell, no logs are produced.
Since the documentation states that the default value for the --watch option is false, ng test (no --watch option provided) should exhibit the same behavior as ng test --watch=false which is to run the tests once and exit.
While the ng test process is hanging, Activity Monitor shows a high number of threads used by the process

I am seeing this same issue but even when just running ng serve
I recently updated macos to mojave and CLI to the latest ... So i think it is one of the two but dont know which one.
Experiencing the same issue with travis and other linux based systems. Even with the --watch=false flag.
You can watch one failing because of this here: https://travis-ci.org/jsaalfeld/OpenSlides/jobs/449709536
Locally this "fails" or stalls also with CLI Version 7.0.4.
Experiencing same behaviour on Angular CLI 6.1.5 after upgrading OSX to Mojave
Angular CLI: 6.1.5
Node: 11.0.0
OS: darwin x64
Angular: 6.1.10
After a short while the process hangs and uses 100 CPU and can only be killed by -9
This happens regardless of --watch being provided to ng test
Gathering info:
angular and CLI version -- does not seem to matter both 6 and 7 are having the issue.
OS -- So far Linux Os's have the issue ... so not only MacOS
I am wondering if it is the upgrade of Node that could be causing it now.
FIX: Downgraded Node using https://medium.com/@katopz/how-to-install-specific-nodejs-version-c6e1cec8aa11 from 11 to 10.13.0
@magleahy did that fix the issue?
@tmburnell yes it did for me.
``_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ â–³ \ | '_ \ / _ | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ __| |_|__, |__,_|_|__,_|_| ____|_____|___|
|___/
Angular CLI: 6.1.3
Node: 10.13.0
OS: darwin x64
Angular: 6.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular-devkit/architect 0.7.2
@angular-devkit/build-angular 0.7.2
@angular-devkit/build-optimizer 0.7.2
@angular-devkit/build-webpack 0.7.2
@angular-devkit/core 0.7.3
@angular-devkit/schematics 0.7.3
@angular/cdk 6.4.2
@angular/cli 6.1.3
@angular/material 6.4.2
@ngtools/webpack 6.1.2
@schematics/angular 0.7.3
@schematics/update 0.7.3
rxjs 6.2.2
typescript 2.9.2
webpack 4.9.2
```
I downgraded node to version 10.13.0. The test process no longer hangs where I have to force close it in Terminal, I am able to use ctrl+c to kill the process. However, running ng test with no watch option still runs the tests in watch mode, but the docs say the default for watch is false.
@hansl do you know why watch shows up in the docs as false? In the schema it doesn't have a default:
https://github.com/angular/angular-cli/blob/0c4b4a6f8bbb0b91dac3ccf482443684222638af/packages/angular_devkit/build_angular/src/karma/schema.json#L83-L85
Regarding node 11, it's not something we test for yet and we'll have to eventually add support to it.
We've been seeing this same issue with Node 8.x (8.9.4 and 8.11.1) as well with @angular-devkit at 0.10.4 with @angular/cli at 7.0.4 (happened with various different 0.10.x/7.0.x builds as well).
As a note, we upgraded to Node 10.13.0 and the Ctrl + C kill still does not kill the process (not on Mojave -- still on High Sierra)
To be clear though: the default option for --watch appears as false in the docs but it's actually undefined. It will respect the Karma config setting if there are any. On a brand new project, ng test will be watching for changes.
As to why ctrl+c doesn't kill the process or why the tests don't run again... I'm not sure. I don't have a Mac to test on. @alan-agius4 @clydin can you reproduce?
@filipesilva, I tried this using Majove 10.14.1 (18B75), running ng test and CTRL+C and it always killed the process. Tried Node versions 10.10.0 , 11.0.0 and 11.1.0.
I think this issue is related (https://github.com/angular/angular-cli/issues/12570)
still hangs no matter what parameters are given
@angular/cli": "7.0.6
ng test --watch=false
Can confirm that watch is true by default.
Hi @drexsoje,
I cannot reproduce this with ~7.1.0 or 7.0.7. Could you upgrade and try again?
It also matters which version of karma you have as this might be a karma bug. Also, it could be a Promise that's still executing.
We recently had this problem too. What caused it for us was that we generated a new angular library. This library used it's default generated karma.conf and not the one from the base project. ng test runs tests from the libraries as well. Because the default is --watch=true ng test now does not stop anymore.
I'm sorry, but we can't reproduce the problem following the instructions you provided.
Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue.
Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.
If the problem persists, please open a new issue following our submission guidelines.
A good way to make a minimal repro is to create a new app via ng new repro-app and add the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
still hangs no matter what parameters are given
@angular/cli": "7.0.6
ng test --watch=false