[GRADLE-3000] logging.captureStandardOutput does not capture all stdout when running in parallel Created: 21/Jan/14  Updated: 06/Feb/17  Resolved: 06/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 4


 Description   

Hi

I have encountered a problem with captureStandardOutput when running several projects in parallel.

The problem is that although I have set logging to capture stdout to log level INFO I get output (on the default lifecycle level) from some sub-projects, but not all. The number of projects emitting the task output is dependent of the number of parallel threads.

In my small setup described below I have four sub-projects besides the root project.
If I set parallel-threads=1 (or up to 4) there is no output, which is the correct behavior in this case. But if I set parallel-threads=5, I get output from one of the projects. With parallel-threads=7, I get output from two of the projects.

This can be easily reproduced by creating a small build.gradle file with this:

defaultTasks 'printSomething'
wrapper {
gradleVersion = '1.10'
}
allprojects {
task printSomething << {
logging.captureStandardOutput LogLevel.INFO
project.exec {
commandLine "echo", "******************* $project *********************"
}
}
}

and a settings.gradle:

include "sub1", "sub2", "sub3", "sub4"

and the empty folders "sub1", "sub2", "sub3", "sub4"

Output:

$ ./gradlew --parallel-threads=4
Parallel execution is an incubating feature.
:printSomething
:sub3:printSomething
:sub2:printSomething
:sub1:printSomething
:sub4:printSomething

$ ./gradlew --parallel-threads=6
Parallel execution is an incubating feature.
:printSomething
:sub4:printSomething
:sub3:printSomething
:sub2:printSomething
:sub1:printSomething

                                      • project ':sub2' *********************

$ ./gradlew --parallel-threads=7
Parallel execution is an incubating feature.
:printSomething
:sub4:printSomething
:sub3:printSomething
:sub2:printSomething
:sub1:printSomething

                                      • project ':sub4' *********************
                                      • root project 'gradlebug' *********************

I have run this on macos 10.9.1



 Comments   
Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Chuck May [ 15/Nov/16 ]

This is still a bug and I would love if this could be looked at. Our parallel build logs are close to unusable because of all the logging noise. Only affects parallel builds.

Comment by Benjamin Muschko [ 06/Feb/17 ]

We are aware of the issue and are currently working on improved console output. For more details please see: https://github.com/gradle/gradle/blob/master/design-docs/improved-console.md. Each of the stories in the spec is represented as a Gradle issue on https://github.com/gradle/gradle-private/issues/456. I propose you follow the work that is currently in flight and open an issue after releasing a significant milestone thereafter if needed.

Generated at Wed Jun 30 12:37:10 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.