-
Notifications
You must be signed in to change notification settings - Fork 8.8k
optimize: Remove hardcoded port configuration in test classes #7460
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
base: 2.x
Are you sure you want to change the base?
Conversation
…ynamic port allocation
be66539
to
40a02a1
Compare
40a02a1
to
56966ac
Compare
# Conflicts: # test/src/test/java/org/apache/seata/core/rpc/netty/MsgVersionHelperTest.java # test/src/test/java/org/apache/seata/core/rpc/netty/RmNettyClientTest.java # test/src/test/java/org/apache/seata/core/rpc/netty/TmNettyClientTest.java # test/src/test/java/org/apache/seata/saga/engine/db/AbstractServerTest.java # test/src/test/java/org/apache/seata/saga/engine/db/StateMachineDBTests.java
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7460 +/- ##
============================================
- Coverage 60.21% 60.20% -0.02%
Complexity 658 658
============================================
Files 1281 1281
Lines 48282 48282
Branches 5676 5676
============================================
- Hits 29075 29066 -9
- Misses 16602 16610 +8
- Partials 2605 2606 +1 🚀 New features to boost your workflow:
|
- Create BaseNettyClientTest as a reusable test base class - Refactor TmNettyClientTest, RmNettyClientTest, and MsgVersionHelperTest - Use dynamic port allocation to prevent port conflicts - Implement unified resource management and cleanup - Support parallel test execution with isolated environments
@YongGoose |
I’ve been a bit delayed in reviewing due to a busy schedule lately — sorry about that. Overall, the code looks good and I didn’t notice any major issues. Last time we talked, we mentioned that mismatched port configurations were causing connection issues during test execution. Could I ask how you addressed that? Also, regarding the CodeCov link in the issue — it might be good to recover the reduced test coverage. |
Thanks for the follow-up! Regarding the port configuration issue — I initially suspected it was caused by port conflicts, since the CodeCov link in the issue pointed to the server and core modules, and I did observe RM connection errors in the CI logs. However, I later found that other PRs did not show the same behavior as #7435 in their CodeCov reports, which suggests the issue is likely unrelated to the previous port mismatch we discussed. After reviewing Codecov’s documentation on unexpected coverage changes, it seems more likely that this is caused by how indirect changes are reported, rather than a bug in the code itself. If you have any suggestions on refining the test setup, I’d be happy to incorporate them! |
I think I’ll need to take a closer look at the logs myself. |
…ynamic port allocation
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Fixes: #7440
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews