oscerd commented on PR #31116:
URL: https://github.com/apache/camel/pull/31116#issuecomment-7275231707

   @davsclaus, thanks, you are right: done in 15700c9 as you suggested.
   
   `SingletonService` now has an `AtomicBoolean` per instance, and 
`doInitializeService` registers the hook only when the flag flips. The 
factories keep their singleton in a static field, so there is one hook per JVM, 
even when another launcher execution (a reused fork that runs the classes one 
by one, or a rerun of failing tests) initializes the singleton again in its own 
root store. That re-initialization is unchanged, as before this PR.
   
   `SingletonServiceTest.registersOneShutdownHookAcrossLauncherExecutions` 
initializes the same instance twice, as two executions do: two initializations, 
one hook. Without the flag it fails on `expected: <1> but was: <2>`. The 28 
tests of the module pass, and the full reactor build is green.
   
   _Claude Code on behalf of Andrea Cosentino_
   


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