borinquenkid opened a new pull request, #16067:
URL: https://github.com/apache/grails-core/pull/16067
## Summary
`GrailsUtilStackFiltererSpec` and `GrailsBootstrapRegistryInitializerSpec`
each have a positive-control
test asserting that `DefaultStackTraceFilterer` emits a `Full Stack Trace:`
message by default. Both
capture that output by swapping `System.err` for a `ByteArrayOutputStream`
around the call.
`DefaultStackTraceFilterer.STACK_LOG` is obtained via commons-logging
(`LogFactory.getLog(STACK_LOG_NAME)`), which on this classpath resolves to a
jcl-over-slf4j binding
(`SLF4JLocationAwareLog`) rather than a bare console writer. The message is
routed through SLF4J/Logback,
so it never reaches `System.err` at all -- the `System.err` swap never
observes anything, regardless of
timing or test ordering. This makes the two "emits by default" tests fail
deterministically:
```
Condition not satisfied:
baos.toString().contains(StackTraceFilterer.FULL_STACK_TRACE_MESSAGE)
| | | |
| "" false
```
This is reproducible on plain `8.0.x` today (no other changes needed) and is
not related to any
in-flight feature branch -- it surfaced as a CI failure on PR #16066 simply
because that PR's CI run
happened to exercise this module's full test suite.
- Replaced the `System.err` capture in both tests with a Logback
`ListAppender` attached directly to
the `StackTrace` logger (`DefaultStackTraceFilterer.STACK_LOG_NAME` -- a
public constant exposed
specifically so tests and logging config can hook into it), detached in
`cleanup`.
- No production code changes; behavior of `DefaultStackTraceFilterer` is
unchanged.
## Test plan
- [x] `:grails-core:test --tests grails.util.GrailsUtilStackFiltererSpec
--tests org.apache.grails.core.GrailsBootstrapRegistryInitializerSpec` -- all
pass
- [x] `:grails-core:test` (full module) -- all pass
- [x] `:grails-core:codeStyle` -- passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]