Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@maple525866
Copy link
Contributor

@maple525866 maple525866 commented Sep 25, 2025

Ⅰ. Describe what this PR did

#7585
With the help of @funky-eyes's analysis, I think it is not a network or port problem, but a visibility problem.
Because the rm member variable in RmClientTest is not declared as volatile, this may cause the rm variable to be modified multiple times during concurrent testing, thus causing this problem。

Here is the fix I made for the problem:

  • The volatile keyword ensures that writes to the rm variable are immediately visible to all threads, preventing instruction reordering.
  • Test ordering: The @TestMethodOrder and @order annotations ensure that tests are executed sequentially, avoiding concurrent access issues.
  • Double-checked locking safety: volatile + synchronized ensures thread-safe lazy loading.

Ⅱ. Does this pull request fix one issue?

fixes #7558

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

mvn clean test

Ⅴ. Special notes for reviews

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.19%. Comparing base (cb3e99b) to head (1341406).
⚠️ Report is 1 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7662      +/-   ##
============================================
+ Coverage     61.03%   61.19%   +0.16%     
  Complexity      666      666              
============================================
  Files          1314     1314              
  Lines         49760    49760              
  Branches       5849     5849              
============================================
+ Hits          30370    30451      +81     
+ Misses        16687    16579     -108     
- Partials       2703     2730      +27     

see 31 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@funky-eyes funky-eyes added this to the 2.6.0 milestone Sep 26, 2025
@funky-eyes funky-eyes added module/test test module type: test test case type: bug Category issues or prs related to bug. labels Sep 26, 2025
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes merged commit a977730 into apache:2.x Sep 28, 2025
13 of 14 checks passed
slievrly pushed a commit to slievrly/fescar that referenced this pull request Oct 21, 2025
YvCeung pushed a commit to YvCeung/incubator-seata that referenced this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/test test module type: bug Category issues or prs related to bug. type: test test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test Failure: io.seata.MockTest.testRollback Fails with RPC Timeout

2 participants