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

On latest SBT (1.2.6) JUnit reporter can mangle output files #1427

Closed
mauhiz opened this Issue Oct 22, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@mauhiz

mauhiz commented Oct 22, 2018

Jenkins reporter then fails with:

Failed to read test report file /home/www/data/jenkins/jenkins_home/workspace/REDACTED/target/test-reports/TEST-com.foo.BarSpec.xml
org.dom4j.DocumentException: Error on line 12 of document  : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.

Examination of this file shows that some contents is written twice, as if two reporters tried to write to the same file without locking.

We've been using forked parallel testing for a while but only after upgrading to SBT 1.2.6 did the problem surface.
EDIT: The bug still shows after disabling forked parallel testing
EDIT2: The bug still shows after disabling forking.

@mauhiz mauhiz changed the title from On latest SBT (1.2.6) JUnit reporter can mangle output files when `testForkedParallel` to On latest SBT (1.2.6) JUnit reporter can mangle output files Oct 22, 2018

@mauhiz

This comment has been minimized.

mauhiz commented Oct 23, 2018

I believe the cause is a regression in SBT. sbt/sbt#4400

Let me close this issue for now as there's nothing to be fixed in scalatest

@mauhiz mauhiz closed this Oct 23, 2018

@mauhiz

This comment has been minimized.

mauhiz commented Oct 23, 2018

For the record, disabling either SBT's built-in JUnitXmlReportPlugin or scalatest's JUnit XML reporter solved the issue.

@itchyny

This comment has been minimized.

itchyny commented Oct 29, 2018

Thanks to your comment, saved my time. I suggest writing the report using atomic write. Users should notice the redundancy in the reports anyway...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment