shuke987 opened a new pull request, #65767: URL: https://github.com/apache/doris/pull/65767
### What problem does this PR solve? Issue Number: DORIS-26901 `CreateResourceCommandTest` starts a real FE, but `testValidate` globally mocks `Env` with JMockit. FE background daemons concurrently call `Env.getServingEnv().isReady()` while the test records expectations. JMockit's process-wide record state is then contaminated, which causes intermittent `MissingInvocation`, incompatible return type, and `ConcurrentModificationException` failures before the resource validation assertions run. The failure appeared in 11 of 80 branch-4.1 FE UT occurrences across 7 unrelated PRs. Related context: - #65072 retained/widened the global JMockit setup on branch-4.1. - #62221 already uses the narrow Mockito pattern on master. ### What is changed? - Keep the real FE `Env` created by `TestWithFeService`. - Spy only `AccessControllerManager` with Mockito. - Stub the single `ADMIN` privilege decision needed by the test and inject the spy into the real environment. - Remove global JMockit mocks for `Env`, `AccessControllerManager`, and `SystemInfoService`. No production code or resource validation assertion is changed. ### Validation - `./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.CreateResourceCommandTest` - `mvn test -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest=org.apache.doris.nereids.trees.plans.commands.CreateResourceCommandTest` - Exact class passed in both rounds: 2 tests, 0 failures, 0 errors per round. - Full Maven reactor succeeded in both rounds. - `git diff --check` passed. ### Check List - [x] Unit test - [x] This is a test-only stabilization; behavior is not changed - [x] No documentation change is required ### Release note None. -- 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]
