davsclaus commented on PR #31253:
URL: https://github.com/apache/camel/pull/31253#issuecomment-7346141470

   I pushed 11ff4fa as a maintainer edit to fix the red JFR test. Digging 
further, my earlier suggestion turned out to be only half of it:
   
   - The `KameletMain` context is built before camel-main configures the 
startup recorder. So the `FlightRecorderStartupStepRecorder` that `KameletMain` 
installs for `jfr` / `jfr-profile` is the one that actually records (to a 
`.jfr` file in the working directory).
   - camel-main then replaced it in the context: with the backlog recorder (the 
dev profile default), or, with `camel.main.startupRecorder=jfr`, with a newly 
discovered flight recorder that is never started. So only setting the main 
options would have made the test pass while asserting on a recorder that does 
not run.
   
   What the commit does:
   - `KameletMain` sets `camel.main.startupRecorder=jfr`, 
`startupRecorderRecording=true` and `startupRecorderProfile` (unless the user 
set them), and applies `startupRecorderDir` and `startupRecorderRuntimeEnabled` 
to its early recorder. The latter is what `RunPipeline` writes for `--jfr`, and 
it was lost before.
   - `BaseMainSupport.configureStartupRecorder` keeps a flight recorder that is 
already set up instead of discovering a new one. This is the same class-name 
check as `DefaultConfigurationConfigurer` uses.
   - `KameletMainInitialPropertyTest` now asserts that the recorder is started, 
is recording, uses the profile and writes its file into the `@TempDir`, so no 
`.jfr` file is left in the module directory. A third test checks that an 
explicit `camel.main.startupRecorder` of the user wins.
   
   Locally: `BaseMainSupportStartupRecorderTest`, the camel-jfr tests and 
`KameletMainInitialPropertyTest` pass.
   
   _Claude Code on behalf of davsclaus_


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