ng test wont finish & hangs

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.2.3
node: 6.9.0
os: darwin x64
@angular/animations: 4.3.1
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.3
@angular/compiler-cli: 4.3.1

### my Karma.conf timeouts

  captureTimeout: 180000,
    browserDisconnectTimeout: 180000,
    browserDisconnectTolerance: 3,
    browserNoActivityTimeout: 180000,
    reportSlowerThan: 2000

Repro steps.

I have like ~300 unit test which used to execute without problem on previous version 1.1.2 and now when I turn them all on it just hangs and after couple minutes HTML reporter shows all success, but command line does not exists.

When I turn like 50 - 100, then it takes like 1.5 min. untill it start printing something to the console and then exists fine. What I see as difference even with 50 test compared what was before is it prints only final result like it start with ZERO

Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 0 of 50 SUCCESS (0 secs / 0 secs)

and then

Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 50 of 50 SUCCESS (0 secs / 0 secs)

But before it was more incremental I could see something like:

Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 0 of 50 SUCCESS (0 secs / 0 secs)
Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 10 of 50 SUCCESS (0 secs / 0 secs)

Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 30 of 50 SUCCESS (0 secs / 0 secs)

Chrome 59.0.3071 (Mac OS X 10.12.5): Executed 45 of 50 SUCCESS (0 secs / 0 secs)
..

It was more progress. When I execute each individually all works.

Desired functionality.

I wish to be able to execute again all my tests

Any pointers I can execute locally to identify the cause?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
filipesilvacommented, Jul 29, 2017

Thanks for getting another look at this. I’ve seen something similar happening in other projects actually, there’s a testing module with a one or two really heavy components and it makes each test take at least 1 sec.

Perhaps you can initialize it once somewhere, import it, and then use resetTestingModule() on the beforeEach? That might be faster.

/cc @wardbell

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 7 : ng test hangs , keeps running tests repeatedly
Try this command ng test -- --watch=false --code-coverage.
Read more >
Angular cli - `ng test` doesn't run? - Visual Studio Feedback
I have a project in VS Team Services with CI Build. One of the build steps is `npm test` which works fine locally,...
Read more >
ng completion - Angular
This modifies your terminal environment to load Angular CLI autocompletion, but can't update your current terminal session. Either restart it or run source...
Read more >
HP Printers - Print jobs stuck in print queue - HP Support
A print job is stuck in the print queue and prevents further print jobs from printing. Cancel and Delete buttons are gray or...
Read more >
How to Stop Jest Tests from Hanging in Angular | by Paul Kim
Jest test hangs, hanging, stuck, never finishes, not running, won't stop. An article to stop hanging Jest tests in an Angular project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found