gnodet-bot commented on code in PR #13695:
URL: https://github.com/apache/maven/pull/13695#discussion_r4366887916


##########
impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/LookupInvokerLoggingTest.java:
##########
@@ -39,15 +41,13 @@ class LookupInvokerLoggingTest {
 
     @BeforeEach
     void setUp() {
-        // Save original system property
         originalSystemProperty = 
System.getProperty(Constants.MAVEN_LOGGER_DEFAULT_LOG_LEVEL);
-        // Clear system property to test configuration file loading
         System.clearProperty(Constants.MAVEN_LOGGER_DEFAULT_LOG_LEVEL);
+        LoggerManager.set(new DefaultLoggerManager());

Review Comment:
   🟡 **Test isolation gap: `tearDown()` should call `LoggerManager.set(null)`.**
   
   `setUp()` installs a fresh `DefaultLoggerManager` as the global singleton, 
but `tearDown()` only restores the system property — it never reverts the 
singleton. Any test class running after this one in the same JVM will inherit 
the `DefaultLoggerManager` installed here instead of discovering its own via 
`ServiceLoader`.
   
   Add this to `tearDown()`:
   ```java
   LoggerManager.set(null);  // let the next test discover its own manager via 
ServiceLoader
   ```



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