apache / apache/maven-surefire

[SUREFIRE-1852] ReporterException: When writing xml report stdout/stderr

Open
#3,014 4 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Zoltan Haindrich](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kgyrtkirk)** opened **[SUREFIRE-1852](https://issues.apache.org/jira/browse/SUREFIRE-1852?redirect=false)** and commented

I'm seeing some junit xml errors lately on ci.hive.apache.org (we are using 3.0.0-M4)

jenkins is unable to parse the junit result xml because its not a valid xml.
I was able to take a look at one of the problematic xmls and it doesn't "end well"

```
(FileInputStream.java:138)
at org.apache.maven.surefire.shade.common.org.apache.commons.io.output.DeferredFileOutputStream.writeTo(DeferredFileOutputStream.java:321)
at org.apache.maven.plugin.surefire.report.Utf8RecodingDeferredFileOutputStream.writeTo(Utf8RecodingDeferredFileOutputStream.java:85)
at org.apache.maven.plugin.surefire.report.StatelessXmlReporter.addOutputStreamElement(StatelessXmlReporter.java:502)
... 13 more
```

I've found some very old 2-3 years old ticket (SUREFIRE-1239) which was fixed...it seems like a similar issue have resurfaced

---

**Affects:** 3.0.0-M4

**Issue Links:**
- [HIVE-24264](https://issues.apache.org/jira/browse/HIVE-24264) Fix failed-to-read errors in precommit runs

Contributor guide

Open the contributing guide

Research direction

Start in StatelessXmlReporter.addOutputStreamElement, especially the DeferredFileOutputStream.writeTo path shown in the stack trace, and review how createOutErrElements serializes stdout/stderr. Reproduce the missing deferred-file case from the report, then verify test reports remain valid XML and no ReporterException is raised.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.