apupier commented on PR #24955:
URL: https://github.com/apache/camel/pull/24955#issuecomment-5043304819

   > The `@AfterEach` cleanup prevents the leak — nice and simple. However, the 
test mutates system properties via 
`System.setProperty("jdk.xml.xpathTotalOpLimit", ...)` (inside 
`XsltComponent.setXpathTotalOpLimit(1)`), so it should also declare a 
**write-mode** `@ResourceLock`:
   > 
   > ```java
   > import org.junit.jupiter.api.parallel.ResourceLock;
   > import org.junit.jupiter.api.parallel.Resources;
   > 
   > @Isolated
   > @ResourceLock(Resources.SYSTEM_PROPERTIES)
   > public class ZXsltTotalOpsTest extends ContextTestSupport {
   > ```
   > 
   > **Why:** `TestSupport` (the grandparent) declares `@ResourceLock(value = 
Resources.SYSTEM_PROPERTIES, mode = READ)`, telling JUnit this test only 
_reads_ system properties. Since this test _writes_ them, the inherited 
declaration is incorrect — it should be overridden with the default 
(READ_WRITE) mode.
   > 
   > `@Isolated` already prevents concurrent execution, so this is not a 
functional bug today, but it's defense in depth and makes the contract explicit.
   
   I will provide a different PR for that as it is not directly related to the 
initial intent of this PR


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