jamesfredley opened a new pull request, #15455: URL: https://github.com/apache/grails-core/pull/15455
## Summary - Fixes intermittent failure in `MicronautErsatzAdvancedSpec > ersatz listener captures request details` (seen in [Functional Tests (17) on PR #15420](https://github.com/apache/grails-core/actions/runs/22367572748/job/64752401657)) - The Ersatz listener callback runs asynchronously on a server thread, but the test asserted `captured.size() == 1` immediately - a race condition where the listener hadn't populated the list yet - Uses `CopyOnWriteArrayList` for thread safety and Spock `PollingConditions` to wait up to 5 seconds for the async listener to complete ## Root Cause ``` captured.size() == 1 | | | | 0 false [{ GET /micronaut-test/listen(...) }] ``` The request was received (visible in the toString), but the listener closure `{ captured << it }` hadn't executed yet when the assertion ran. Plain `ArrayList` is also not thread-safe for cross-thread writes. -- 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]
