jdaugherty opened a new pull request, #16697:
URL: https://github.com/apache/grails-core/pull/16697

   `CreateControllerCommandSpec > test app with controller` failed on the 
"Build Grails Forge (17)" job of #16690 ([run 
39468211729](https://github.com/apache/grails-core/actions/runs/39468211729/job/118785082091))
 with
   
   > Timed out after 600s waiting for the generated build to produce [BUILD 
SUCCESSFUL]; the build was still running.
   
   and only the daemon-fork preamble as build output. The generated build had 
in fact already finished: the `gradle/actions: Writing build results` line in 
that output is printed when the build's services close, and no task header was 
ever printed, so the build failed while configuring. Gradle writes the failure 
report to stderr, which `CommandSpec` never read (`consumeProcessOutputStream` 
drains stdout only). Once a `-S` report outgrows the 64 KiB pipe buffer, the 
Gradle client blocks on the write and never exits, and the harness, which keys 
its early exit on process liveness, waits out its whole budget. The sibling 
specs ran the same generated build in 35-47 s right after.
   
   Reproduced locally with Gradle 8.14.6: a configuration failure whose report 
is 161 KB exits in 3 s with stderr drained, and is still running after 120 s 
with stderr unread, with exactly the two preamble lines on stdout.
   
   This merges stderr into the stream the consumer thread drains, so a failed 
build exits at once and its failure report is part of the assertion message. 
`CommandSpecBuildFailureSpec` covers it with a generated project whose build 
fails while configuring with a report larger than the pipe buffer: against the 
old harness it times out after 600 s exactly as CI did; with the change it 
passes in 5 s.
   
   The `test-core` copy of `CommandSpec` runs its builds through Gradle 
TestKit, whose `BuildResult.getOutput()` carries both streams, so it is 
unaffected.
   
   The trigger of the configuration failure in that run is unrecoverable from 
its logs. If it recurs, the assertion message will now carry the Gradle failure 
report.
   
   Verified locally: `:grails-forge-cli:test --tests 
org.grails.forge.cli.CommandSpecBuildFailureSpec` and 
`:grails-forge-cli:codeStyle`. The full generated-build specs are left to CI.
   
   Targets 7.0.x, to be merged up.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to