-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Script Error while running Karma start #1268
Comments
@Giriraj24 It reproduced only in PhantomJS? |
I have the same issue. After spending a couple hours debugging it I have found that it somehow seems to be related to the number of tests. However, that's not purely the problem because running thousands of near-blank tests in a new project works fine. For me, if I go over 103 tests, about 70% of the time it fails at test 77 with:
It doesn't seem to matter where I add the tests in my current project, or what is in the tests (even if they are blank). However, as mentioned, if I start up a fresh project, randomly add a few thousand near-blank tests, it works fine. Weird. Not sure how to continue debugging it at this point. Though it feels like it might be a memory leak somewhere. @Giriraj24 did you find any resolution? I'm running the following: |
@ehacke do you use external script in your project? |
@maksimr I pull one thing in from Stripe using JSONP, but I don't directly call a cross-domain script. It also looks like there is no problem running the full suite of tests in Firefox, the issue only happens in PhantomJS. |
@maksimr to be more specific, I have this in my index.html
But it seems that if it were a cross-site scripting issue, I would expect it to fail 100% of the time with any number of tests, not pass with 103 tests, and then fail 80% of the time when I add 1 more blank test. And I'd expect it to fail in Firefox, which it does not. |
Maybe, but will be cool if you try remove/mock this script and reproduce error. Thanks |
@maksimr Yeah I'll give it a shot and update once I've eliminated all the possible same-origin issues. |
@maksimr After some searching it looks like one of the dependencies I pulled in with bower was doing some sneaky creation of html and directly including a script tag which called a remote google .js file. Removing just that dependency and references to it fixed the issue. Thanks! That was most likely the problem. The Stripe JSONP calls don't seem to cause problems. Still weird that it would only arise once I included a certain number of unrelated tests though. And weird that it would only trigger a failure 70-80% of the time. But in any case, thanks a lot for your help, and to others with this issue, deeply search your dependencies. |
@ehacke no problems |
Hi, i'm not able execute all of the test case because of this error(skip few of the test case while executing.) how to debug this error |
Hi all Running "clean:server" (clean) task
Running "wiredep:app" (wiredep) task Running "wiredep:test" (wiredep) task Running "concurrent:test" (concurrent) task Running "copy:styles" (copy) task Done, without errors. Running "autoprefixer:server" (autoprefixer) task Running "autoprefixer:dist" (autoprefixer) task Running "connect:test" (connect) task Running "karma:unit" (karma) task Aborted due to warnings. |
@krishna005, |
@Deepakdubey90 |
@krishna005, |
@Deepakdubey90 |
@krishna005 , |
@Deepakdubey90 Running "karma:unit" (karma) task Aborted due to warnings. |
Has anyone found any fix for this? I'm facing the same problem in my Jenkins CI server and the tests run perfectly in local env but fails in CI, UNLESS I decrease the number of tests. It seems like it can only run 139-140 tests successfully but after that it starts giving PLEASE issue a fix for this! |
+1 the same issue, fixed by simply adding 1 dummy test. Absolutely no idea why... |
@ehacke I don't think it's weird it is only after you added X amount of tests etc. fits the profile. @olala7846 what do you mean by 'dummy' ? what test did you add that solved this issue. Also - is it possible to alert on external scripts loading which will help debugging the issue? |
@GuyMograbi thanks for responding. it('pass', () => {
expect(true).toBe(true)
}) And I think It may have something to do with race condition, I haven't seen this type of error after I use jasmine clock instead of patching window.time myself |
im running into the same issue dummies didnt work for me |
I had this problem (the "Script error" message with no helpful information), and here's how I fixed it. This might not work for you, and maybe there are more causes than what I fixed in my case, but the following might help debug. In my case I am using karma-electron, but that may not matter much, as this error appears to happen with different browsers, as mentioned here and in #543. It appears that when there are uncaught errors, the browser propagates the error to Karma somehow, but without all the details. So what I did (and it is ugly) was I made karma wrap all my tests with This completely solved the issue for me, now any errors are logged to console. One way that you can set this up is, at the top of your
Basically that's what I did, more or less. Now when I run Karma, I see helpful error messages logged to console instead of just Note, a more robust way to do it is make new entry points in the Your mileage may vary if it isn't the same issue. |
Hi All,
Let me give the back ground.
Almost around one month back, I used to run 1600 Unit test cases with out any problem. Every thing was working fine.
One fine day, We started getting "Disconnected" error message and at times just place "script error" with unknown reasons so it stopped running the UTC's. So we decided to upgrade the karma from "0.12.16" to the latest one(0.12.28) but that also did not fix the issue. then as next option we upgraded our jasmine from 1.3.0 version to jasmine-2.0* version and that also did not solve the problem.
To drill down the problem, we decided to put less number of test cases, like just to 50 to find out the problem.
so when I run the unit test cases today, out of running 10 times, 8 times I am getting following error about "script error":
[jenkins@xcclx0000 workspace]$ karma start
INFO [karma]: Karma v0.12.28 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket aEsvNiTaam8VX0g4HllC with id 4602773
PhantomJS 1.9.8 (Linux) ERROR
Script error.
PhantomJS 1.9.8 (Linux): Executed 47 of 50 ERROR (0 secs / 3.533 secs)
PhantomJS 1.9.8 (Linux) ERROR
PhantomJS 1.9.8 (Linux): Executed 47 of 50 ERROR (3.549 secs / 3.533 secs)
PhantomJS 1.9.8 (Linux): Executed 47 of 50 ERROR (3.549 secs / 3.533 secs)
Following versions of karma,node and phantomJS I am using:
so I got no idea why this suddenly started failing. It was all good one month back where I was able to run 1600 test cases, now I am unable to run 50 as well.
If you also want to see karma.conf.js content then let me know , I can paste it here.
But please help. Any help will be really great.
Thanks,
Giriraj
The text was updated successfully, but these errors were encountered: