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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma builder logs a lot of file changes with "builderMode: application" #28755

Closed
1 task
cexbrayat opened this issue Oct 31, 2024 · 2 comments · Fixed by #28794
Closed
1 task

Karma builder logs a lot of file changes with "builderMode: application" #28755

cexbrayat opened this issue Oct 31, 2024 · 2 comments · Fixed by #28794

Comments

@cexbrayat
Copy link
Member

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When running ng test in watch mode, updating a file triggers a re-run of the tests as expected, but sometimes logs a lot of file changes.

Minimal Reproduction

Create a new project with npx @angular/[email protected] new karma-assets --defaults --no-routing.
Add "builderMode": "application", to angular.json in the karmaoptions.
Launch ng test
Clear the template app.component.html and check the logs.

Exception or Error

31 10 2024 07:31:27.111:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/app.component.spec.js.map".
31 10 2024 07:31:27.112:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/styles.css.map".
31 10 2024 07:31:27.112:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/styles.css".
31 10 2024 07:31:27.113:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/init_test_bed.js".
31 10 2024 07:31:27.113:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/app.component.spec.js".
31 10 2024 07:31:27.113:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/app.component.css.map".
31 10 2024 07:31:27.114:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/polyfills.js".
31 10 2024 07:31:27.116:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/init_test_bed.js.map".
31 10 2024 07:31:27.122:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/chunk-K7Q6MHAJ.js".
31 10 2024 07:31:27.128:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/polyfills.js.map".
31 10 2024 07:31:27.155:INFO [filelist]: Changed file "/Users/cedric/Code/temp/karma-assets/dist/test-out/c45dfc31-7cf6-461e-b12e-14642f1f29ac/chunk-K7Q6MHAJ.js.map".

Your Environment

Angular CLI: 19.0.0-rc.0
Node: 20.13.1
Package Manager: npm 9.7.1
OS: darwin arm64

Angular: 19.0.0-rc.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1900.0-rc.0
@angular-devkit/build-angular 19.0.0-rc.0
@angular-devkit/core 19.0.0-rc.0
@angular-devkit/schematics 19.0.0-rc.0
@schematics/angular 19.0.0-rc.0
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0

Anything else relevant?

No response

@jkrems jkrems self-assigned this Nov 5, 2024
jkrems added a commit to jkrems/angular-cli that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes angular#28755
jkrems added a commit to jkrems/angular-cli that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes angular#28755
jkrems added a commit to jkrems/angular-cli that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes angular#28755
jkrems added a commit to jkrems/angular-cli that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes angular#28755
jkrems added a commit that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes #28755
jkrems added a commit that referenced this issue Nov 5, 2024
The Karma file watching was racing with the file writes done by the
application builder. Since we already tell Karma when to reun via
`.refeshFiles()`, disabling Karma's own file watcher should make
things more reliable.

This allows removing a weird special-case in the test case and
removes the noisy "File chaned" logs generated by Karma.

Fixes #28755

(cherry picked from commit faabbbf)
@jkrems
Copy link
Contributor

jkrems commented Nov 5, 2024

Thanks for the great reports! I'm hoping that we can get the fixes for this and #28756 / #28754 into the next RC release.

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

Successfully merging a pull request may close this issue.

3 participants