-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement-12296][Test] Close static mock #12300
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #12300 +/- ##
=========================================
Coverage 38.53% 38.53%
Complexity 4075 4075
=========================================
Files 1023 1023
Lines 38267 38267
Branches 4393 4393
=========================================
Hits 14748 14748
Misses 21796 21796
Partials 1723 1723 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
e032794
to
c436d3d
Compare
rebased dev to remove conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, waiting for CI to pass
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
If no more comments, I will proceed to merge this PR later this afternoon. |
Purpose of the pull request
Brief change log
In some UT cases, static mocks are not closed after used. This may cause unexpected UT failure. The best practice is to handle it with try-with-resource, see the code below for an example:
dolphinscheduler/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/FileUtilsTest.java
Lines 39 to 43 in a973054
Verify this pull request
manually tested