borinquenkid opened a new pull request, #16032:
URL: https://github.com/apache/grails-core/pull/16032
## Summary
`RunningApplicationProcessSpec > stop terminates a running process and
removes the PID
file` is flaky (~2% of runs per apache/grails-core#16030), 0 hard failures —
same
commit, different outcome on rerun.
## Root cause
`RunningApplicationProcess.stop()` already behaves correctly: it calls
`process.destroy()`, blocks on `ProcessHandle.onExit()`, falls back to
`destroyForcibly()`, and its final check queries the OS process table
directly
(`!process.isAlive()`) — accurate regardless of reaper-thread scheduling.
The bug is
purely a timing budget: the test's 15s total wasn't enough headroom for the
JVM's
process-reaper notification under CI contention (many parallel Gradle forks
each
spawning child processes), occasionally causing `stop()` to report
`STILL_RUNNING`
instead of `STOPPED`.
This file was already patched twice before for a related Windows race
(6c76333ea9/a13c38c3fd) — those touched the test's tail assertion but never
this
timeout budget.
## Fix
No production code changed — `awaitExit()`'s fallback is already correct, so
hardening
it further would add complexity without addressing the actual bottleneck.
Bumped the
test's `stop(pidFile, 15000)` call to `30000`ms, giving realistic headroom
on a
contended runner. Smallest reviewable diff.
## Testing
- `:grails-shell-cli:test` (full module): 3 separate runs (forced-fresh,
isolated-fresh-JVM `--rerun-tasks --no-daemon`, and cached) all BUILD
SUCCESSFUL,
target spec passing in each.
- No new test coverage required (no production change); reviewed that the
existing
test still fully exercises real stop-terminates-process behavior.
- CodeNarc/Checkstyle: clean, including a full repo-wide
`aggregateStyleViolations`
run (740 tasks).
Related: apache/grails-core#16030
--
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]