jenkinsci / jenkinsci/junit-plugin
[JENKINS-27931] stdout/stderr are truncated even on failing test
- Dominant language
- Java
- Stars
- 87
- Forks
- 351
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 2
Description
A test class with many tests in it may produce "large" logs on stdout. In that case, if there is a test failing within this test class, I would have expected that the entire stdout output is kept by junit plugin.
But it is truncated.
...[truncated 1051034 chars]...
This seems to be voluntary: https://github.com/jenkinsci/junit-plugin/commit/5f7513baff89516cd7217ea39101ad67116cd059
I totally understand the need of discard data for tests succeed. However for failing tests, it makes almost impossible to find the cause of failure.
Besides, it contradicts the documentation of the option Retain long standard output/error which states:
If checked, any standard output or error from a test suite will be retained in the test results after the build completes. (This refers only to additional messages printed to console, not to a failure stack trace.) Such output is always kept if the test failed, but by default lengthy output from passing tests is truncated to save space. Check this option if you need to see every log message from even passing tests, but beware that Jenkins's memory consumption can substantially increase as a result, even if you never look at the test results!
Is that possible to at least make this configurable ? In my workflow, the ideal would be to completely discard passing tests logs, and keep all of failing ones.
---
Originally reported by alexv, imported from: stdout/stderr are truncated even on failing test
Raw content of original issue
A test class with many tests in it may produce "large" logs on stdout. In that case, if there is a test failing within this test class, I would have expected that the entire stdout output is kept by junit plugin.
But it is truncated.
...[truncated 1051034 chars]...This seems to be voluntary: https://github.com/jenkinsci/junit-plugin/commit/5f7513baff89516cd7217ea39101ad67116cd059
I totally understand the need of discard data for tests succeed. However for failing tests, it makes almost impossible to find the cause of failure.
Besides, it contradicts the documentation of the option Retain long standard output/error which states:
If checked, any standard output or error from a test suite will be retained in the test results after the build completes. (This refers only to additional messages printed to console, not to a failure stack trace.) Such output is always kept if the test failed, but by default lengthy output from passing tests is truncated to save space. Check this option if you need to see every log message from even passing tests, but beware that Jenkins's memory consumption can substantially increase as a result, even if you never look at the test results!
Is that possible to at least make this configurable ? In my workflow, the ideal would be to completely discard passing tests logs, and keep all of failing ones.
environment
```
Jenkins 1.609, 2.60.2
Junit plugin 1.5
```
Contributor guide
Research direction
Start by reviewing the referenced commit 5f7513baff89516cd7217ea39101ad67116cd059 and the junit-plugin code that handles retained stdout and stderr. Reproduce a large-output test class containing a failing test, then verify that the configured behavior preserves failing-test output while allowing passing-test logs to be discarded.
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