allthingssecurity opened a new pull request, #29672:
URL: https://github.com/apache/camel/pull/29672

   # Description
   
   [CAMEL-26871](https://issues.apache.org/jira/browse/CAMEL-26871)
   
   The camel-core suite run with the exchange sanitizer on (`mvn test 
-Psanitizer`, the CI switch of camel-sanitizer, CAMEL-26714) has 8 failures on 
main: the tests of #29525 and #29575 (CAMEL-26741) that throw a 
`VirtualMachineError` (`StackOverflowError`, `OutOfMemoryError`) from a 
processor or a bean method, 5 in `ProcessorThrowsErrorTest` and 3 in 
`BeanMethodThrowsErrorTest`. By design such an `Error` is thrown on after the 
callback was called, and these tests check exactly that; rule R1 reports it as 
"process threw after calling the callback", so each fails with a 
`SanitizerViolationError`.
   
   Change: the 8 tests say so with 
`@ExpectSanitizerViolation(Violation.THREW_AFTER_CALLBACK)`, as the other tests 
of camel-core that break the rule on purpose do (`StepListenerTest`, 
`StepWithoutErrorHandlerProcessorThrowsTest`). Without the sanitizer the 
annotation has no effect. Test code only.
   
   An alternative is for the sanitizer not to report a `VirtualMachineError` 
thrown after the callback at all, as Camel throws it on there on purpose. I 
kept the rule as it is, as the sanitizer page already documents (a 
`VirtualMachineError` is still thrown on after the callback, and reported): 
with an error handler such an exchange completes without an exception and the 
`Error` is only logged, so the report is what fails a test that runs into one 
by accident.
   
   With the change, the whole camel-core suite with `-Psanitizer` passes: 9166 
run, 0 failures, 0 errors, 46 skipped (the R1 reports are only in the tests 
that expect them). Without the switch the two classes pass (8 and 12 tests).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it): 
[CAMEL-26871](https://issues.apache.org/jira/browse/CAMEL-26871).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built the core modules with the formatter and import-sort plugins and 
ran the camel-core tests with and without the sanitizer. I did not run the full 
root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 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]

Reply via email to