Coder Social home page Coder Social logo

Comments (12)

rhencke avatar rhencke commented on August 19, 2024 1

@muhammad-ammar We 'fixed' this locally in our case but it took code changes to karma-junit-reporter. (I say 'fixed' because we did not address the underlying bug - we just made it work despite that).

I don't have the code changes handy but our workaround looked very much like the one in @alexeibs's fork here: https://github.com/Megaputer/karma-junit-reporter/commit/d14b9bffe0d3d658b8a99e2854b3e8070e50c11f and here: https://github.com/Megaputer/karma-junit-reporter/commit/9138c062c343262bccaa71571aca30d6e11d579b). You may want to try that for now.

from karma-junit-reporter.

dcheslow avatar dcheslow commented on August 19, 2024

I am having a similar (related?) problem. The browser Safari gets disconnected and then Karma tries to use the browser again, producing the same symptom. Note that the property name (last line) and the browser id for Safari (first line) are the same:

INFO [Safari 7.0.5 (Mac OS X 10.9.4)]: Connected on socket zTI9jtNWzoZKrulU5Q6n with id 10854247
INFO [Chrome 35.0.1916 (Mac OS X 10.9.4)]: Connected on socket 6Yt7AmX6_1c3OOi05Q6o with id 7862841
INFO [Safari 7.0.5 (Mac OS X 10.9.4)]: Connected on socket xCdLA-A3zbzrI_mO5Q6m with id 40855390
INFO [Firefox 30.0.0 (Mac OS X 10.9)]: Connected on socket voBi3f_NPvl77owT5Q6p with id 68411812
................................................................................
................................................................................
.....................................................................
Safari 7.0.5 (Mac OS X 10.9.4): Executed 135 of 135�[32m SUCCESS�[39m (0.7 secs / 0.64 secs)
................................................................................
................................................................................
Chrome 35.0.1916 (Mac OS X 10.9.4): Executed 135 of 135�[32m SUCCESS�[39m (1.288 secs / 1.204 secs)
................
Firefox 30.0.0 (Mac OS X 10.9): Executed 135 of 135�[32m SUCCESS�[39m (1.37 secs / 1.271 secs)
�[32mTOTAL: 405 SUCCESS�[39m
WARN [Safari 7.0.5 (Mac OS X 10.9.4)]: Disconnected (1 times)
Safari 7.0.5 (Mac OS X 10.9.4): Executed 0 of 135�[31m DISCONNECTED�[39m (3.28 secs / 0 secs)
Fatal error: Cannot read property '10854247' of null

My current work-around sucks quite a lot: remove Safari, build, re-add Safari, build again.
I have tried various fiddling with timeouts and disconnect tolerance.... no joy.
It seems to me that the base problem is that Safari is getting disconnected, not that the failed browser is a fatal error.
Any/all suggestions are appreciated.

from karma-junit-reporter.

hyzhak avatar hyzhak commented on August 19, 2024

I have same problem with Phantom JS and [email protected] but after 100 tests are passed. It fails occasionally. So after some reloads, all tests are passed without any problem, but in general it is weird experience:

TypeError: Cannot read property '73488940' of null
    at JUnitReporter.specSuccess.specSkipped.specFailure (.....\node_modules\karma-junit-reporter\index.js:89:22)
    at BaseReporter.onSpecComplete (.....\node_modules\karma\lib\reporters\base.js:83:12)
    at bindMethod (.....\node_modules\karma\lib\events.js:15:22)
    at EventEmitter.emit (events.js:117:20)
    at Browser.onResult (.....\node_modules\karma\lib\browser.js:213:13)
    at Socket.bindMethod (.....\node_modules\karma\lib\events.js:15:22)
    at Socket.EventEmitter.emit [as $emit] (events.js:117:20)
    at SocketNamespace.handlePacket (.....\node_modules\karma\node_modules\socket.io\lib\namespace.js:335:22)
    at Manager.onClientMessage (.....\node_modules\karma\node_modules\socket.io\lib\manager.js:518:38)
    at WebSocket.Transport.onMessage (.....\node_modules\karma\node_modules\socket.io\lib\transport.js:369:20)

How to fix this bug?

from karma-junit-reporter.

j0tunn avatar j0tunn commented on August 19, 2024

Looks like it relates to karma itself: karma-runner/karma#1248
And it was fixed

from karma-junit-reporter.

wookets avatar wookets commented on August 19, 2024

Are we sure this was fixed?

I'm seeing this in Karma 0.12.31.

Fatal error: Cannot read property '21770261' of null


Actually my issue appears to be an async test not been done properly...

from karma-junit-reporter.

rhencke avatar rhencke commented on August 19, 2024

I believe I've distilled this error (or one very, very much like it) down to a minimal reproduction - this consistently errors with TypeError: Cannot read property 'somenumber' of null

To reproduce:

git clone https://gist.github.com/rhencke/919d12c168e2300da133 bug20
cd bug20
npm install
npm test

from karma-junit-reporter.

rhencke avatar rhencke commented on August 19, 2024

I think the underlying bug for this is actually karma-runner/karma#1292

What is happening is that onRunComplete is called, and suites is set to null at https://github.com/karma-runner/karma-junit-reporter/blob/master/index.js#L120. Then, later, a specSuccess/specSkipped/specFailure arrives (https://github.com/karma-runner/karma-junit-reporter/blob/v0.2.2/index.js#L89 from @hyzhak 's stack trace, but now https://github.com/karma-runner/karma-junit-reporter/blob/v0.3.8/index.js#L125 in the current release). It attempts to reference suites, but suites has been set to null, and the TypeError occurs.

from karma-junit-reporter.

tomwetjens avatar tomwetjens commented on August 19, 2024

Still experiencing this issue with karma 0.13.22 and karma-junit-reporter 0.4.0. Can you please merge the workaround by @alexeibs https://github.com/Megaputer/karma-junit-reporter/commit/d14b9bffe0d3d658b8a99e2854b3e8070e50c11f until karma-runner/karma#1292 is solved?

from karma-junit-reporter.

muhammad-ammar avatar muhammad-ammar commented on August 19, 2024

Still getting this issue with karma 0.13.22 and karma-junit-reporter 0.4.1. Any way to fix this issue?

from karma-junit-reporter.

muhammad-ammar avatar muhammad-ammar commented on August 19, 2024

👍 @rhencke Thanks a lot for your reply and commit links.

from karma-junit-reporter.

stramel avatar stramel commented on August 19, 2024

karma-runner/karma#1292

from karma-junit-reporter.

wesleycho avatar wesleycho commented on August 19, 2024

This error should be fixed in the karma-junit-reporter 1.2.0 release.

from karma-junit-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.