github-actions[bot] commented on code in PR #62221:
URL: https://github.com/apache/doris/pull/62221#discussion_r3068816033


##########
fe/fe-core/src/test/java/org/apache/doris/catalog/FakeEnv.java:
##########
@@ -17,18 +17,31 @@
 
 package org.apache.doris.catalog;
 
+import org.apache.doris.common.jmockit.Deencapsulation;
+import org.apache.doris.ha.FrontendNodeType;
 import org.apache.doris.system.SystemInfoService;
 
-import mockit.Mock;
-import mockit.MockUp;
+import org.mockito.MockedStatic;
+import org.mockito.Mockito;
 
-public class FakeEnv extends MockUp<Env> {
+public class FakeEnv implements AutoCloseable {
 
     private static Env env;
     private static int metaVersion;
     private static SystemInfoService systemInfo = new SystemInfoService();
+    private MockedStatic<Env> mockedStatic;
+
+    public FakeEnv() {

Review Comment:
   Switching `FakeEnv` from a JMockit `MockUp` to a `MockedStatic` changes its 
lifecycle contract: callers now have to `close()` it, otherwise the overridden 
`Env` statics stay registered for the rest of the worker thread. There are 
still existing users that were not updated in this PR, for example 
`PartitionKeyTest.testSerialization()` just does `new FakeEnv()` and never 
closes it. That makes FE UT order-dependent on this branch. Please either 
migrate every remaining `FakeEnv` caller in the same change, or keep the helper 
semantics self-contained so historical callers cannot leak mock state into 
later tests.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to