Skip to content

Angular CLI 14: running ng test --watch=false on Angular 13 or 12 project does not end process when complete #23289

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

Closed
1 of 15 tasks
Blackbaud-PaulCrowder opened this issue Jun 3, 2022 · 4 comments · Fixed by #23298
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@Blackbaud-PaulCrowder
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, globally installing Angular CLI 13 worked with both Angular 13 and Angular 12 projects when running ng test --watch=false.

Description

Installing Angular CLI 14 globally and running ng test --watch=false on an Angular 13 or Angular 12 application results in the process never terminating. This causes CI builds to hang indefinitely on any step that runs Angular unit tests using this command.

🔬 Minimal Reproduction

  • Run npm i @angular/cli@13 -g to Install Angular CLI 13.
  • Run ng new to create a new Angular application. I chose to add Angular routing and selected SCSS for the stylesheet format. Selecting SCSS seems to be required to reproduce the issue, but adding routing does not.
  • Run ng test --watch=false and observe the tests running, then the process terminating after completion.
  • Run npm i @angular/cli@14 -g to install Angular CLI 14.
  • Run ng test --watch=false. The message Your global Angular CLI version (14.0.0) is greater than your local version (13.3.7). The local Angular CLI version is used. will be displayed. Observe the tests running, then the process continuing to run even after the tests complete.

🔥 Exception or Error

N/A

🌍 Your Environment

macOS 12.4
node 14.17.6
npm 6.14.15

Global ng version

Angular CLI: 14.0.0
Node: 14.17.6
Package Manager: npm 6.14.15 
OS: darwin x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1400.0 (cli-only)
@angular-devkit/core         14.0.0 (cli-only)
@angular-devkit/schematics   14.0.0 (cli-only)
@schematics/angular          14.0.0 (cli-only)

ng version inside application directory

Angular CLI: 13.3.7
Node: 14.17.6
Package Manager: npm 6.14.15
OS: darwin x64

Angular: 13.3.11
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.7
@angular-devkit/build-angular   13.3.7
@angular-devkit/core            13.3.7
@angular-devkit/schematics      13.3.7
@angular/cli                    13.3.7
@schematics/angular             13.3.7
rxjs                            7.5.5
typescript                      4.6.4

Anything else relevant?

I was not able to reproduce the issue if I selected "CSS" instead of "SCSS" when creating the SPA.

@alan-agius4
Copy link
Collaborator

This will be fixed once you update your project CLI to version 14.

As an interim solution you can also downgrade the global CLI to version 13

@Blackbaud-PaulCrowder
Copy link
Author

This will be fixed once you update your project CLI to version 14.

As an interim solution you can also downgrade the global CLI to version 13

We did downgrade to Angular CLI 13 to get around the issue, but this is going to be problematic for developers who are maintaining both Angular 14 and Angular 13 projects or are gradually migrating multiple SPAs.

@Fly1nP4nda
Copy link

I encountered a similar issue here running ng build alone and using a global CLI version of 14 and a version 13 (and lower) project CLI. Downgrading did fix the issue but not ideal as @Blackbaud-PaulCrowder mentioned.

My company CI (Concourse) builds were hanging indefinitely without any output until I associated it to the v14 release on 6/2

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely area: @angular/cli labels Jun 6, 2022
@ngbot ngbot bot modified the milestone: Backlog Jun 6, 2022
clydin added a commit to clydin/angular-cli that referenced this issue Jun 7, 2022
…ions

Angular CLI versions prior to v14 may not exit correctly if not forcibly exited
via `process.exit`. When the local CLI version is less than v14, the CLI will now
use `process.exit` to ensure the process exits with these older CLI versions.

Fixes angular#23289
clydin added a commit that referenced this issue Jun 7, 2022
…ions

Angular CLI versions prior to v14 may not exit correctly if not forcibly exited
via `process.exit`. When the local CLI version is less than v14, the CLI will now
use `process.exit` to ensure the process exits with these older CLI versions.

Fixes #23289
clydin added a commit that referenced this issue Jun 7, 2022
…ions

Angular CLI versions prior to v14 may not exit correctly if not forcibly exited
via `process.exit`. When the local CLI version is less than v14, the CLI will now
use `process.exit` to ensure the process exits with these older CLI versions.

Fixes #23289

(cherry picked from commit d788263)
jbedard pushed a commit to jbedard/angular-cli that referenced this issue Jun 7, 2022
…ions

Angular CLI versions prior to v14 may not exit correctly if not forcibly exited
via `process.exit`. When the local CLI version is less than v14, the CLI will now
use `process.exit` to ensure the process exits with these older CLI versions.

Fixes angular#23289
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants