-
Notifications
You must be signed in to change notification settings - Fork 144
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
sometimes junit-reported just doesn't generate reports #188
Comments
its even very weird, i can't just explain this. |
@jcompagner I seem to be running into this issue as well. When run locally or triggering a jenkins build manually it will generally create the report. However, as part of scheduled jenkins builds the report now often isn't generated. Have you found out anything else since then? |
The thing is lately we don't have many problems anymore with that... we didn't change must also on karma.config i think this is really the only change that we did: Servoy/servoy-eclipse@5b9c3a6#diff-2fdd2a7830de8c7d13672d8e85cd91f3fe6e74a941e0642110a2b3bffcd4da83R29 |
Thanks for getting back to me so soon. I think the only change we had since this started occuring were minor npm updates as well. So maybe getting to latest might fix things. |
We are seeing this issue as well. I'm starting to wonder if this is a karma issue, as we had the same issue in a coverage reporter and had to revert to an older unsupported coverage reporter. Seems odd that two different reporters would have the same issue and be the reporter code versus a common bug in the karma plugin code that it isn't waiting for the promise to complete of the reporter before exiting the process. The other issue I am referring to is from this project, but it is the karma-coverage reporter: karma-runner/karma-coverage#434 Our "fix" was to uninstall karma-coverage and use the deprecated Or perhaps there is shared code in karma-runner between Looking at the source code for FYI, that code can be seen here: https://github.com/mattlewis92/karma-coverage-istanbul-reporter/blob/b61dd3067a4c60270a71508fdce8d4f95ed1f4bc/src/reporter.js#L242 |
I added some
Diff:
So, from the extra console logs, I can see that
at the top of my job this was printed:
Perhaps, since the browser was restarted, the reporter has the wrong value for the
and it would therefore skip the creation of the report. I can't reproduce this locally, but can ~75% of the time on Jenkins. I can try to get better information, but I cannot debug it, only can really use console logs. I'll keep trying, but let me know if you need more information |
After putting in more logging, I do not see |
Looks like this is a reproduction of this issue: |
Work-around that seems to be functioning:
With context:
|
Hello, I forked the project to test @arobinson's workaround and unfortunately I still get test executions without coverage reports sometimes.
Any other ideas? |
On our CI system the junit reporter sometimes (about 1 in 10 runs) doesn't write to disk. When that happens the 'progress' reporter also writes empty lines instead of something like Looking at the progress reporter code empty lines will be output if So my conclusion is the same as @arobinson - this is an issue in Karma core. |
I am not sure if this plugin of karma is to blame or that this is a problem in karma itself.
It is very annoying that our builds now and then break when we run it on Jenkins because our jobs are configured to fail/error the build when there are no karma reports found.
And now and then (sometimes it goed ok for quite a few builds, and then suddenly it can fail a few times after each other) this plugin doesn't generate the reports.
I am running karma in full debug output that i paste below, there you see 2 runs you see everything is successful but in 1 of them 1 output line is missing: [INFO] 19 03 2021 14:05:36.674:DEBUG [reporter.junit]: JUnit results written to "/[fullpath]/target/TEST-browser-karma.xml".
how can this happen?
the one that is fine:
[INFO] Chrome Headless 89.0.4389.82 (Linux x86_64): Executed 198 of 225 (skipped 27) SUCCESS (7.294 secs / 5.876 secs)
[INFO] 19 03 2021 14:05:36.432:DEBUG [launcher]: CAPTURED -> BEING_KILLED
[INFO] 19 03 2021 14:05:36.432:DEBUG [launcher]: BEING_KILLED -> BEING_FORCE_KILLED
[INFO] 19 03 2021 14:05:36.432:DEBUG [Chrome Headless 89.0.4389.82 (Linux x86_64)]: CONNECTED -> DISCONNECTED
[INFO] TOTAL: 198 SUCCESS
[INFO] TOTAL: 198 SUCCESS
[INFO] 19 03 2021 14:05:36.579:DEBUG [karma-server]: Run complete, exiting.
[INFO] 19 03 2021 14:05:36.580:DEBUG [launcher]: Disconnecting all browsers
[INFO] 19 03 2021 14:05:36.580:DEBUG [launcher]: BEING_FORCE_KILLED -> BEING_FORCE_KILLED
[INFO] 19 03 2021 14:05:36.587:DEBUG [proxy]: Destroying proxy agents
[INFO] 19 03 2021 14:05:36.663:DEBUG [launcher]: Process ChromeHeadless exited with code null and signal SIGTERM
[INFO] 19 03 2021 14:05:36.663:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-12630893
[INFO] 19 03 2021 14:05:36.674:DEBUG [reporter.junit]: JUnit results written to "[fullpath]/target/TEST-browser-karma.xml".
[INFO] 19 03 2021 14:05:36.691:DEBUG [launcher]: Finished all browsers
[INFO] 19 03 2021 14:05:36.692:DEBUG [launcher]: BEING_FORCE_KILLED -> FINISHED
[INFO] 19 03 2021 14:05:36.692:DEBUG [launcher]: FINISHED -> FINISHED
[INFO] 19 03 2021 14:05:36.698:DEBUG [karma-server]: Received stop event, exiting.
[INFO] 19 03 2021 14:05:36.698:DEBUG [launcher]: Disconnecting all browsers
[INFO] 19 03 2021 14:05:36.699:DEBUG [launcher]: FINISHED -> BEING_FORCE_KILLED
[INFO] 19 03 2021 14:05:36.699:DEBUG [proxy]: Destroying proxy agents
the one that fails:
[INFO] 21 03 2021 22:37:56.802:DEBUG [Chrome Headless 89.0.4389.82 (Linux x86_64)]: EXECUTING -> CONNECTED
[INFO]
[INFO] 21 03 2021 22:37:56.816:DEBUG [launcher]: CAPTURED -> BEING_KILLED
[INFO] 21 03 2021 22:37:56.816:DEBUG [launcher]: BEING_KILLED -> BEING_FORCE_KILLED
[INFO] 21 03 2021 22:37:56.817:DEBUG [Chrome Headless 89.0.4389.82 (Linux x86_64)]: CONNECTED -> DISCONNECTED
[INFO] TOTAL: 198 SUCCESS
[INFO] TOTAL: 198 SUCCESS
[INFO] 21 03 2021 22:37:57.078:DEBUG [karma-server]: Run complete, exiting.
[INFO] 21 03 2021 22:37:57.090:DEBUG [launcher]: Disconnecting all browsers
[INFO] 21 03 2021 22:37:57.090:DEBUG [launcher]: BEING_FORCE_KILLED -> BEING_FORCE_KILLED
[INFO] 21 03 2021 22:37:57.102:DEBUG [proxy]: Destroying proxy agents
[INFO] 21 03 2021 22:37:57.449:DEBUG [launcher]: Process ChromeHeadless exited with code null and signal SIGTERM
[INFO] 21 03 2021 22:37:57.449:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-58044430
[INFO] 21 03 2021 22:37:57.610:DEBUG [launcher]: Finished all browsers
[INFO] 21 03 2021 22:37:57.610:DEBUG [launcher]: BEING_FORCE_KILLED -> FINISHED
[INFO] 21 03 2021 22:37:57.610:DEBUG [launcher]: FINISHED -> FINISHED
[INFO] 21 03 2021 22:37:57.614:DEBUG [karma-server]: Received stop event, exiting.
[INFO] 21 03 2021 22:37:57.615:DEBUG [launcher]: Disconnecting all browsers
[INFO] 21 03 2021 22:37:57.615:DEBUG [launcher]: FINISHED -> BEING_FORCE_KILLED
[INFO] 21 03 2021 22:37:57.615:DEBUG [proxy]: Destroying proxy agents
The text was updated successfully, but these errors were encountered: