Hello Santiago, Thanks for reporting it, I managed to reproduce the issue, as you reported, the CamelContext is not stopped after tests complete.
I opened https://issues.apache.org/jira/browse/CAMEL-23116 and https://github.com/apache/camel/pull/21679 . You are correct, the issue is that *.stop()* is a NO-OP method in the *LegacyCamelContextManager*, while *.close()* is supposed to do a full clean up. Regards, Federico Il giorno dom 1 mar 2026 alle ore 13:09 Santiago Acosta < [email protected]> ha scritto: > Hi > > I am doing a big upgrade jump from 4.6.0 to 4.17.0 and I have hit a snag > regarding my tests (I use CamelTestSupport with the PER_CLASS annotation). > > While I was trying to understand why some of my test classes processes leak > into the next test class, I discovered that my clean up routines where not > being executed "after stop" and causing all sorts of noise. > > I went down the rabbit hole to find why my clean up routines were not being > executed correctly and found that > the LegacyCamelContextManager::doStopCamelContext method is called in the > method ::close. > > The interface describes that CamelContextManager::close (copied from the > source code) > > Close the manager (this is run after all tests have been executed) > > > *However, I cannot seem to find where or how this ::close function is being > called.* > > Are we supposed to call this method ourselves? > > I know that the 4.6 -> 4.8 jump is quite big but I think I have solved all > of my quandaries except for this one which has taken me quite a while to > pin down. >
