Comments (17)
Related? karma-runner/karma#3560 (comment)
I set clearContext: config.singleRun
in my local karma.config and the error goes away...
from angular-cli.
It caused my pre-push hook to fail and I had to switch off the hooks to be able to push so for us it appears to be actually causing a non-zero exit.
from angular-cli.
@dgp1130, I was able to replicate this issue exclusively on macOS, and it occurs in both headless and non-headless modes of Chrome version 128.0.0.0.
When --watch
is set to a non-truthy value, I also observed the Some of your tests did a full page reload!
error appearing when the browser closes after all tests have successfully run. However, in my case, the process did not terminate with a non-zero exit code.
from angular-cli.
Related? karma-runner/karma#3560 (comment)
I set
clearContext: config.singleRun
in my local karma.config and the error goes away...
This works for me.
Environment:
Angular 17
macOS Sonoma
from angular-cli.
Same happened here after update Chrome to v128.0.0.0.
Angular CLI: 17.3.8
Node: 18.20.3
Package Manager: npm 10.7.0
OS: darwin arm64
Angular: 17.3.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1703.8
@angular-devkit/build-angular 17.3.8
@angular-devkit/core 17.3.8
@angular-devkit/schematics 17.3.8
@angular/cdk 17.3.10
@angular/cli 17.3.8
@angular/material 17.3.10
@schematics/angular 17.3.8
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.10
from angular-cli.
I also have this issue. I'm only commenting to add that I ONLY see the problem in non-watch mode : ng test --watch=false
from angular-cli.
The same thing happened here after updating Chrome to v128.0.0.0.
from angular-cli.
I ONLY see the problem in non-watch mode :
ng test --watch=false
I noticed that too, but I think once you stop watching it'll spit out the error.
from angular-cli.
Also seeing this, and it's not a specific test that fails:
Angular CLI: 18.2.1
Node: 22.7.0
Package Manager: npm 10.8.2
OS: darwin x64
Angular: 18.2.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... platform-server, router, ssr
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.1
@angular-devkit/build-angular 18.2.1
@angular-devkit/core 18.2.1
@angular-devkit/schematics 18.2.1
@schematics/angular 18.2.1
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
Test output:
> ng test --watch=false --browsers=ChromeHeadless
✔ Browser application bundle generation complete.
23 08 2024 15:49:17.645:INFO [karma-server]: Karma v6.4.4 server started at http://localhost:9876/
23 08 2024 15:49:17.647:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
23 08 2024 15:49:17.651:INFO [launcher]: Starting browser ChromeHeadless
23 08 2024 15:49:19.042:INFO [Chrome Headless 128.0.0.0 (Mac OS 10.15.7)]: Connected on socket 0lhJDWyRZAKUz0g-AAAB with id 93949148
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 0 of 36 SUCCESS (0 secs / 0 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 36 of 36 SUCCESS (0.536 secs / 0.5 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7) ERROR
Some of your tests did a full page reload!
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 36 of 36 ERROR (0.536 secs / 0.5 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7) ERROR
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 36 of 36 ERROR (0.55 secs / 0.5 secs)
from angular-cli.
Similar issue here, does not appear on watch=true
. I can't find what is the root cause of it.
Angular CLI: 18.0.4
Node: 22.2.0
Package Manager: npm 10.7.0
OS: darwin arm64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1800.4
@angular-devkit/core 18.0.4
@angular-devkit/schematics 18.0.4
@schematics/angular 18.0.4
> ng test --no-watch --no-progress --browsers=ChromeHeadless
26 08 2024 13:56:56.078:INFO [karma-server]: Karma v6.4.3 server started at http://localhost:9876/
26 08 2024 13:56:56.079:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
26 08 2024 13:56:56.081:INFO [launcher]: Starting browser ChromeHeadless
26 08 2024 13:56:56.739:INFO [Chrome Headless 128.0.0.0 (Mac OS 10.15.7)]: Connected on socket SRHYT2w467iGirpgAAAB with id 23475697
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 10 of 73 SUCCESS (0 secs / 0.045 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 73 of 73 SUCCESS (0.191 secs / 0.173 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7) ERROR
Some of your tests did a full page reload!
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 73 of 73 ERROR (0.191 secs / 0.173 secs)
Chrome Headless 128.0.0.0 (Mac OS 10.15.7) ERROR
Chrome Headless 128.0.0.0 (Mac OS 10.15.7): Executed 73 of 73 ERROR (0.195 secs / 0.173 secs)
from angular-cli.
Related? karma-runner/karma#3560 (comment)
I set
clearContext: config.singleRun
in my local karma.config and the error goes away...
In my case I did the same but still getting the error
from angular-cli.
I'm chatting with some Karma folks to see if we can understand what's going on here. Unfortunately we're not able to reproduce the exact issue, so I have a few questions someone can maybe help out with:
- Can anyone provide a minimal example? The OP suggests "To reproduce you can simply create a new project and run
ng test
.", though that's not sufficient for me. I'm wondering if anyone can confirm on their end that this is a sufficient reproduction, or if other requirements are necessary? - All the reports I see here list
Chrome Headless
. Is anyone able to reproduce with a "headfull" test? - Related, is anyone able to reproduce with
--headless=new
? I suspect using theChromeHeadless
browser likely uses the old version of--headless
in Chrome and I'm wondering if the issue might be related to that. I think testing both of these require specifying a "custom browser" in your Karma config. - All the reports I see here are also
darwin arm64
. I happen to be on Linux, so I'm wondering if anyone can reproduce on a non-Mac to at least rule out that particular aspect as a key requirement. - Do tests actually fail because of this error (
exit code != 0
) or is this just a spurious warning which doesn't actually affect the result of the test?
from angular-cli.
@dgp1130
I'll take a stab at answering some of these from what I see:
Chrome version: 128.0.6613.85
@angular/core: 17.3.10
@angular/cli: 17.3.8
- Can anyone provide a minimal example? The OP suggests "To reproduce you can simply create a new project and run ng test.", though that's not sufficient for me. I'm wondering if anyone can confirm on their end that this is a sufficient reproduction, or if other requirements are necessary?
I cannot do this. I just got the error and I am rushing to deliver a product. Maybe if no one else does, I can follow-up later on Tues.
- All the reports I see here list Chrome Headless. Is anyone able to reproduce with a "headfull" test?
I have ran ng test
and I do not get the error. Then I run the tests in headless mode and I see the error.
- Related, is anyone able to reproduce with --headless=new? I suspect using the ChromeHeadless browser likely uses the old version of --headless in Chrome and I'm wondering if the issue might be related to that. I think testing both of these require specifying a "custom browser" in your Karma config.
I added --headless=new
to my karma.config.js and the error persists
- All the reports I see here are also darwin arm64. I happen to be on Linux, so I'm wondering if anyone can reproduce on a non-Mac to at least rule out that particular aspect as a key requirement.
I am also on a darwin arm64, so I cannot help there :(
- Do tests actually fail because of this error (exit code != 0) or is this just a spurious warning which doesn't actually affect the result of the test?
- I ran
echo $?
after running the headless tests and it responded with0
. So maybe it wouldn't cause a failure. - I ran the tests in our pipeline, but it currently uses Chrome 124.0.6367.201 and it didn't report any error.
from angular-cli.
I have ng test
on my pre-commit using husky. If it throws an code != 0
I wouldn't able to commit and I can.
I'll watch for a minimal example but same as Stargator I get this error on a enterprise product I cannot show the code.
from angular-cli.
Related Issues (20)
- Followup of #24916 ng serve often caches old component code HOT 4
- Report which route failed during pre-rendering.
- support playwright in ng e2e HOT 1
- `ng test` runs multiple instances of the browser HOT 5
- Add more feature to generation schematics HOT 1
- Transitive dependencies hoisted by rollup cause warnings when importing libraries with multiple chunks HOT 3
- `--disable-host-check` doesn't work with new build system HOT 2
- The service was stopped HOT 1
- PWA not working with vite-based dev server HOT 3
- Broken offline service workers (504) after migrating to @angular-devkit/build-angular:application from :browser HOT 3
- The service was stopped HOT 4
- Esbuild/vite doesn't have a loader for .node files HOT 1
- `extract-i18n` tries to read `assets/*.js` files from memory and doesn't find it.
- Compile-time constant replacement (like DefinePlugin) HOT 8
- extract-i18n error since @angular-devkit/[email protected] HOT 2
- Failed to resolve import "./chunks/helpers.segment.js" from ".angular/vite-root/project_name/scripts.js". HOT 1
- Tests using web-test-runner fail on multi project apps HOT 1
- `@angular-devkit/build-angular:dev-server` not working for application with builder `@angular-devkit/build-angular:server` HOT 1
- ng test command broken when using Node.js 22 on version 18.2.0 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-cli.