This is an automated email from the ASF dual-hosted git repository.

jdaugherty pushed a commit to branch ci/conserve-actions-minutes
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 0cf1b9cb238b916ea8c2c31de640c91a067437d9
Author: Scott Murphy Heiberg <[email protected]>
AuthorDate: Sat Oct 17 11:15:25 2026 -0700

    [skip tests] test: wait for the stopped process to exit in 
RunningApplicationProcessSpec
    
    stop() terminates the process through its ProcessHandle, and on Windows a
    ProcessHandle judges the process by its exit code. TerminateProcess records
    that code as soon as termination starts, so onExit() completes and stop()
    returns STOPPED while Windows is still tearing the process down. The spec
    then asked the Process whether it was alive, and on Windows that waits for
    the process object to be signalled, which happens only once the teardown
    ends. The Windows JDK 25 build caught the gap:
    
        !process.isAlive()
        ||       |
        ||       true
        |Process[pid=7412, exitValue=1]
    
    The exit value 1 is the code destroy() terminates with, read in the same
    instant isAlive() still answered true. The spec now waits for the process
    to exit instead of requiring it to be gone already.
    
    (cherry picked from commit 10cf675644d096dcbb1fd13bcebc451f06a1eba6)
---
 .../groovy/org/grails/cli/gradle/RunningApplicationProcessSpec.groovy | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/grails-shell-cli/src/test/groovy/org/grails/cli/gradle/RunningApplicationProcessSpec.groovy
 
b/grails-shell-cli/src/test/groovy/org/grails/cli/gradle/RunningApplicationProcessSpec.groovy
index 7fb2c5669b..0af55782f5 100644
--- 
a/grails-shell-cli/src/test/groovy/org/grails/cli/gradle/RunningApplicationProcessSpec.groovy
+++ 
b/grails-shell-cli/src/test/groovy/org/grails/cli/gradle/RunningApplicationProcessSpec.groovy
@@ -214,6 +214,8 @@ class RunningApplicationProcessSpec extends Specification {
         then:
         result == RunningApplicationProcess.StopResult.STOPPED
         !pidFile.exists()
-        !process.isAlive()
+
+        and: "the process exits; Windows records its exit code, which is all 
stop() sees, before it finishes tearing it down"
+        process.waitFor(5, TimeUnit.SECONDS)
     }
 }

Reply via email to