apache / apache/maven-surefire
StatelessXmlReporter + ParameterizedClass leads to quadratic writes
- Dominant language
- Java
- Stars
- 461
- Forks
- 588
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 19
Description
### Affected version
3.5.6
### Bug description
Observed with JUnit 5.14.3: runtime of a test file that uses `ParameterizedClass` grows dramatically as the number of parameterized test sets gets into the hundreds and beyond. Rewriting the test file to use `ParameterizedTest` reduces the runtime back to a reasonable level.
From looking at the output directory while the test suite is running, it seems like the `TEST-.xml` is getting continuously rewritten to be slightly larger each time a test set runs. The growth in runtime combined with this observation suggests that quadratic writes are happening. Perhaps something could be adjusted to write out the report for each test set just once, and then combine them when they're all done.
Contributor guide
Research direction
Start by tracing StatlessXmlReporter handling for ParameterizedClass and reproduce the issue with a test file containing hundreds of parameterized test sets. Observe how the TEST-.xml report is written during execution; done means the runtime no longer grows quadratically and the final report still combines all test sets correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100