Comments (11)
Great find! This should be fixed in the latest release.
from karma-parallel.
@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.
Please tag a release when you get the chance, good sir.
from karma-parallel.
Oh yes, sorry. Done
from karma-parallel.
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.
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.
Thanks, yea I didn’t see it. I’ll be able to look at it on Tuesday or so.
from karma-parallel.
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.
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.
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.
@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)
- karma-parallel do not return exit code 1 anymore on too low code coverage HOT 7
- Exception when using "karma run" HOT 7
- Should fail the test cases split to a browser that is disconnected HOT 4
- Aggregated Log Output HOT 10
- No support for Circle CI HOT 2
- Support Karma 4 HOT 1
- When browser disconnects, remaining tests are skipped HOT 5
- Random failures with uncaught errors and missing tests
- Jasmine test timeout is ignored HOT 1
- Random test failures during CI process
- How to enable running tests in parallel on CI
- Publish new version HOT 2
- No calculation of all passed tests on kubernetis -job
- Script Error while executing karma tests HOT 1
- Only supporting Jasmine ?
- Karma parallel cannot find any tests after starting Chrome
- Need help to get code coverage HOT 3
- `Parallel` throws away global beforeEach in multi-browser mode
- Is there a way to let what files to run in what threads/browser instances ?
- failSpecWithNoExpectations to true in jasmine and karma-parallel add the extra tests HOT 1
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 karma-parallel.