-
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
Reporter writes spec results out of order #3211
Reporter writes spec results out of order #3211
Comments
The order of test execution is determined by the test framework, |
@johnjbarton, thanks for the quick response. Can you please have a look at my PR #3212. I doubt this is the correct fix, as I'm not sure what is going on with the For my test, |
The fix is almost correct. Tests broke because of JavaScript greatness. Guess what will happen when array is empty? By default Socket.io would use long polling for communication and then it would upgrade to WebSockets if it is available in the current browser. Buffering was originally introduced in c4ad697 to workaround reliability issues in some ancient Safari. Not sure if it is necessary anymore, but that's a different story. This bug was introduced in 603872c. The problem is the race condition between running tests and the Socket.io upgrading to the WebSocket protocol. If test runner reported any results before an upgrade to the WebSocket protocol, they will not be sent to the server until test run is complete. |
🎉 This issue has been resolved in version 5.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [5.0.3](karma-runner/karma@v5.0.2...v5.0.3) (2020-04-29) ### Bug Fixes * **client:** flush resultsBuffer on engine upgrade ([karma-runner#3212](karma-runner#3212)) ([e44ca94](karma-runner@e44ca94)), closes [karma-runner#3211](karma-runner#3211)
Expected behaviour
Reporter should see specs in the order they were defined. I have three groups of four tests which all pass:
Actual behaviour
Reporter sees specs out of order:
Environment Details
karma --version
):Karma version: 3.1.1
karma.config.js
fileDump of
test.js
:I am using
karma-spec-reporter
, but have reduced it to a bare minimum and still reproduce the problem:Steps to reproduce the behaviour
test.js
andkarma.conf.js
karma-spec-reporter
karma start
to reproducesecond
so all tests are synchronous, and note that order is now correctObservations
The text was updated successfully, but these errors were encountered: