apupier opened a new pull request, #31247: URL: https://github.com/apache/camel/pull/31247
# Description JIRA: https://issues.apache.org/jira/browse/CAMEL-28025 (found through the flaky test CAMEL-28024) Robot Framework runs in-process on Jython. Each run redirects the JVM wide `System.out` and `System.err` (`JavaCapturer` in `robot.running.outputcapture`), so two runs that overlap in the same JVM close or replace each other's streams. This makes concurrent use of the `robotframework` component (several routes, consumers or exchanges) fail with `IOError: java.nio.channels.ClosedChannelException`, `ValueError: I/O operation on closed file` or `IndexError: pop from empty list`, and can corrupt the output files. It also made `RobotFrameworkOptionsFixTest` flaky when test classes run concurrently. The change: - `RobotFrameworkEndpoint`: `RobotFramework.run(...)` is called under a JVM wide `ReentrantLock`, so runs never overlap. - `robotframework-component.adoc` (and the catalog copy): a note that one Robot Framework execution runs at a time per JVM. Separate output directories per test class were tried and do not help, as the redirected console streams are the shared state. Running Robot Framework in a separate process would give real isolation, but is a larger change and not part of this fix. # 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). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. Verified: the module tests pass with `-Dcamel.surefire.parallel=true -Dcamel.surefire.parallel.factor=4` (3 runs); they failed before the change. _Bob (IBM AI assistant) on behalf of @apupier_ -- 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]
