BoyuLi4 opened a new pull request, #4252:
URL: https://github.com/apache/shenyu/pull/4252

   <!-- Describe your PR here; eg. Fixes #issueNo -->
   
   <!--
   Thank you for proposing a pull request. This template will guide you through 
the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [X] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your 
changes.
   - [X] Your local test passed `./mvnw clean install 
-Dmaven.javadoc.skip=true`.
   - 
   ## What is the purpose of the change
   The test file in module 
`shenyu/shenyu-client/shenyu-client-http/shenyu-client-springmvc` 
   ```
   org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListenerTest.java
   ```
   has flakiness due to the running order of the tests.
   
   If we run `testOnApplicationEvent()` before other tests, it might caused an 
error
   `For org.apache.shenyu.register.client.http.utils.RegisterUtils, static 
mocking is already registered in the current thread`
   
   The returned object's MockedStatic.close() method must be called upon 
completing the test.
   
   ## Brief changelog
   
   We might import `junit.TestMethodOrder` to define the running order of the 
test.
   But I found we may add `registerUtilsMockedStatic.close();` at the end of 
the test `testOnApplicationEvent()` even it did not use 
`registerUtilsMockedStatic`
   
   ## Verifying this change
   The test will passed in any order.
   And it passed the local test that the guidelines mentioned.
   
   


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