GithubHelp home page GithubHelp logo

Comments (11)

joeljeske avatar joeljeske commented on April 20, 2024 2

Great find! This should be fixed in the latest release.

from karma-parallel.

joeljeske avatar joeljeske commented on April 20, 2024 2

@kkempster94 Sorry for the delay, I have tracked down your issue and it should be fixed in the latest release, 0.2.3. It was a mocha-specific issue and I did not catch it before. I finally took the time it implement a test setup for this project that tests various configurations including mocha so that mocha should remain stable. Thanks for the patience.

from karma-parallel.

kkempster94 avatar kkempster94 commented on April 20, 2024

Please tag a release when you get the chance, good sir.

from karma-parallel.

joeljeske avatar joeljeske commented on April 20, 2024

Oh yes, sorry. Done

from karma-parallel.

kkempster94 avatar kkempster94 commented on April 20, 2024

looks like I'm running into some odd errors when I try to focus tests:

"message": "Uncaught TypeError: Cannot read property 'parent' of undefined
at c:/someDirectory/node_modules/mocha/mocha.js:737:14

TypeError: Cannot read property 'parent' of undefined
at Object.only (c:/someDirectory/node_modules/mocha/mocha.js:737:14)
at context.it.only (c:/someDirectory/node_modules/mocha/mocha.js:585:26)
at c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:88:12
at Suite. (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:132:47)
at Suite. (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:65:13)
at Object.create (c:/someDirectory/node_modules/mocha/mocha.js:717:19)
at context.describe.context.context (c:/someDirectory/node_modules/mocha/mocha.js:532:27)
at c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:88:12
at Object.beforeStartup (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:131:13)
at ContextKarma.karma.start (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:16:23)",
"str": "Uncaught TypeError: Cannot read property 'parent' of undefined
at c:/someDirectory/node_modules/mocha/mocha.js:737:14

TypeError: Cannot read property 'parent' of undefined
at Object.only (c:/someDirectory/node_modules/mocha/mocha.js:737:14)
at context.it.only (c:/someDirectory/node_modules/mocha/mocha.js:585:26)
at c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:88:12
at Suite. (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:132:47)
at Suite. (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:65:13)
at Object.create (c:/someDirectory/node_modules/mocha/mocha.js:717:19)
at context.describe.context.context (c:/someDirectory/node_modules/mocha/mocha.js:532:27)
at c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:88:12
at Object.beforeStartup (c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:131:13)
at ContextKarma.karma.start `(c:/someDirectory/node_modules/karma-parallel/lib/karma-parallelizer.js:16:23)"

It looks like the number of these errors directly corresponds with n - 1 where n is the number of browser instances. I would assume that is because the browser instance running the non-fake test which is focused is not erroring, while all the other instances with fake tests are.

from karma-parallel.

kkempster94 avatar kkempster94 commented on April 20, 2024

bumping this issue in case you didn't notice it. Also, the code throwing this error is: https://github.com/mochajs/mocha/blob/f01f66ec19249d90280c81142b87b01a29f5b80b/lib/interfaces/common.js#L132.

from karma-parallel.

joeljeske avatar joeljeske commented on April 20, 2024

Thanks, yea I didn’t see it. I’ll be able to look at it on Tuesday or so.

from karma-parallel.

jamesopti avatar jamesopti commented on April 20, 2024

I believe my tests are failing with the same issue. We call this.timeout in many tests, and the this context is incorrect in the n+1 cases (1 executor works fine)

from karma-parallel.

joeljeske avatar joeljeske commented on April 20, 2024

Interesting, thanks for the tip. Are you calling that in a before() or it() block? Or maybe inside the describe directly?

Could you send a small example of a failure?

from karma-parallel.

jamesopti avatar jamesopti commented on April 20, 2024

We commonly call it inside the beginning of the root describe in a test file:

describe('some_module/some_component', function() {
  this.timeout(10000);

  // Setup and run some tests
  ...
});

Here is an example output:

➜  myapp git:(karma_parallel) grunt test:myapp:unit
Running "test:myapp:unit" (test) task

Running "karma:myapp:unit" (karma) task

START:
Hash: e0bdc8cc97632b01d813
Version: webpack 2.4.1
Time: 44ms
webpack: Compiled successfully.
webpack: Compiling...
Hash: e0fab60a728ee52c6d84
Version: webpack 2.4.1
Time: 21798ms
                     Asset     Size  Chunks                    Chunk Names
               0.bundle.js   273 kB       0  [emitted]  [big]  extras_bundle
               1.bundle.js   110 kB       1  [emitted]         stub_data_bundle
             firstparty.js  6.97 MB       2  [emitted]  [big]  firstparty
src/js/tests/myapp/main.js  1.79 MB       3  [emitted]  [big]  src/js/tests/myapp/main.js
                 vendor.js  8.22 MB       4  [emitted]  [big]  vendor

webpack: Compiled with warnings.
Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught TypeError: this.timeout is not a function
  at src/js/tests/myapp/main.js:287
Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught TypeError: this.timeout is not a function
  at src/js/tests/myapp/main.js:356

Finished in 2.413 secs / 0 secs

SUMMARY:
✔ 0 tests completed
Warning: Task "karma:myapp:unit" failed. Use --force to continue.

Aborted due to warnings.

And the relevant portion of the karma config:

  frameworks: ['parallel', 'mocha-debug', 'mocha'],

    parallelOptions: {
      executors: 2, // Defaults to cpu-count - 1
      shardStrategy: 'round-robin',
    },

Also I realized I was wrong about which ones fail. Not just n+1 fails, they all do.

Hope this helps!

from karma-parallel.

joeljeske avatar joeljeske commented on April 20, 2024

@jamesopti Your issue is not the same as @kkempster94 and will require a some thought and a different approach. Would you mind opening a new issue?

from karma-parallel.

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.