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

   `ErrorsFunctionalSpec` › "Test Interceptor.afterView() has access to the 
exception if thrown" fails intermittently in the `app1` and Hibernate 7 `app1` 
functional jobs (#16415 on 2026-09-28, `grails8-groovy6-canary` on 2026-08-02):
   
   ```
   System.properties[ErrorsControllerInterceptor.PROPERTY] == 'Oops!'
   |                 |
   |                 null
   ```
   
   `ErrorsControllerInterceptor` sets the property from `afterView()`, which 
runs from `afterCompletion`, after `GrailsExceptionResolver` has forwarded the 
request to the 500 mapping. A forward sends and closes the response before it 
returns, so the browser can have the error page, and the spec check the 
property, before `afterView()` has run.
   
   The check now waits for the property:
   
   ```groovy
   then: "afterView() runs after the error page's forward has sent and closed 
the response, so the page can load first"
   waitFor { System.properties[ErrorsControllerInterceptor.PROPERTY] == 'Oops!' 
}
   ```
   
   Test-only; both copies of the spec (`app1` and `hibernate7/app1`) pass 
locally.
   


-- 
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