Skip to content

test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584)#7584

Merged
funky-eyes merged 2 commits into
apache:2.xfrom
jihun4452:fix/consul-config-test-deflake
Aug 14, 2025
Merged

test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584)#7584
funky-eyes merged 2 commits into
apache:2.xfrom
jihun4452:fix/consul-config-test-deflake

Conversation

@jihun4452

@jihun4452 jihun4452 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor
  • I have read the CONTRIBUTING.md guidelines.
  • I have registered the PR changes.
    (N/A for this PR: test-only, no user-facing change)

Ⅰ. Describe what this PR did

Deflake ConsulConfigurationTest.testInitSeataConfig by adding a short await/retry loop (up to ~3s with 100ms backoff).
This absorbs occasional CI timing/propagation delays when reading the mocked Consul KV so the assertion remains stable.
No production code changes — test-only.

Ⅱ. Does this pull request fix one issue?

Fixes #7583.

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

This PR modifies the failing test itself. The flakiness comes from timing, not functionality, so adding new tests would not add coverage.

Ⅳ. Describe how to verify it

Run the module tests repeatedly and confirm they pass:

# run just the consul config module (build deps included)
./mvnw -pl config/seata-config-consul -am test

# or target the single test method
./mvnw -q -pl config/seata-config-consul -am \
  -Dtest=org.apache.seata.config.consul.ConsulConfigurationTest#testInitSeataConfig \
  -Dsurefire.printSummary=true -Dsurefire.useFile=false \
  -DfailIfNoTests=false \
  test

Ⅴ. Special notes for reviews

  • Adds a bounded wait (≤3s) only to absorb CI timing; the original assertion remains.
  • No production code touched.
  • If preferred, we can swap to Awaitility, but avoided adding deps.

… short await/retry to absorb CI timing delay (fixes apache#7583)

Signed-off-by: 박지훈 <jihun6548@naver.com>
@jihun4452

Copy link
Copy Markdown
Contributor Author

CI-only deflake; no production code changes.
Maintainers: please approve CI workflow run. 🙏

@funky-eyes funky-eyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@funky-eyes funky-eyes added this to the 2.6.0 milestone Aug 14, 2025
@funky-eyes funky-eyes added module/config config module module/test test module type: test test case and removed module/test test module labels Aug 14, 2025
@codecov

codecov Bot commented Aug 14, 2025

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##                2.x    #7584   +/-   ##
=========================================
  Coverage     61.36%   61.37%           
  Complexity      658      658           
=========================================
  Files          1310     1310           
  Lines         49568    49568           
  Branches       5834     5834           
=========================================
+ Hits          30416    30420    +4     
+ Misses        16436    16435    -1     
+ Partials       2716     2713    -3     

see 3 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 closed this Aug 14, 2025
@funky-eyes funky-eyes reopened this Aug 14, 2025
jihun4452 added a commit to jihun4452/incubator-seata that referenced this pull request Aug 14, 2025
…ig with short await/retry to absorb CI timing delay
@funky-eyes

Copy link
Copy Markdown
Contributor

I will open and close this PR several times in order to rerun the CI, so that I can determine whether the issue is likely to be fixed.

@funky-eyes

Copy link
Copy Markdown
Contributor

I’d like the title to be a bit more concise, this one is a little too long.

@jihun4452 jihun4452 force-pushed the fix/consul-config-test-deflake branch from c4a58f4 to e35396a Compare August 14, 2025 06:15
@jihun4452

Copy link
Copy Markdown
Contributor Author

I've updated the PR title to make it more concise as suggested. Please review.

@jihun4452

Copy link
Copy Markdown
Contributor Author

Sorry for the interruption earlier — it seems the CI run was interrupted.
I've updated the PR title as suggested and it's now ready for review again.

@jihun4452 jihun4452 changed the title test: deflake ConsulConfigurationTest#testInitSeataConfig with short await/retry to absorb CI timing delay (fixes #7583) test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584) Aug 14, 2025
@jihun4452 jihun4452 changed the title test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584) test: deflake ConsulConfigurationTest#testInitSeataConfig (#7583) Aug 14, 2025
@jihun4452 jihun4452 changed the title test: deflake ConsulConfigurationTest#testInitSeataConfig (#7583) test: deflake ConsulConfigurationTest#testInitSeataConfig (#7584) Aug 14, 2025
@funky-eyes funky-eyes closed this Aug 14, 2025
@funky-eyes funky-eyes reopened this Aug 14, 2025
@funky-eyes

Copy link
Copy Markdown
Contributor

Sorry for the interruption earlier — it seems the CI run was interrupted. I've updated the PR title as suggested and it's now ready for review again.

2025-08-14 06:40:22,842 [SEATA] [main] INFO  io.seata.MockTest - branch register(0.6.1) ok, branchId=9690077789048841
2025-08-14 06:40:22,843 [SEATA] [ServerHandlerThread_1_27_500] INFO  org.apache.seata.mockserver.processor.MockRemotingProcessor - process message : SeataMergeMessage GlobalCommitRequest{xid='172.18.0.1:8077:9690077789048840', extraData='null'}

2025-08-14 06:40:22,845 [SEATA] [rpcDispatch_RMROLE_7_8] INFO  io.seata.core.rpc.netty.RmMessageListener - onMessage:xid=172.18.0.1:8077:9690077789048840,branchId=9690077789048841,branchType=TCC,resourceId=mock-action-061,applicationData={"mock":"mock"}
2025-08-14 06:40:22,845 [SEATA] [rpcDispatch_RMROLE_7_8] INFO  io.seata.rm.AbstractRMHandler - Branch committing: 172.18.0.1:8077:9690077789048840 9690077789048841 mock-action-061 {"mock":"mock"}
commitTcc:172.18.0.1:8077:9690077789048840,null
2025-08-14 06:40:22,845 [SEATA] [rpcDispatch_RMROLE_7_8] INFO  io.seata.rm.AbstractResourceManager - TCC resource commit result :true, xid:172.18.0.1:8077:9690077789048840, branchId:9690077789048841, resourceId:mock-action-061
2025-08-14 06:40:22,845 [SEATA] [rpcDispatch_RMROLE_7_8] INFO  io.seata.rm.AbstractRMHandler - Branch commit result: PhaseTwo_Committed
2025-08-14 06:40:22,845 [SEATA] [rpcDispatch_RMROLE_7_8] INFO  io.seata.core.rpc.netty.RmRpcClient - RmRpcClient sendResponse xid=172.18.0.1:8077:9690077789048840,branchId=9690077789048841,branchStatus=PhaseTwo_Committed,result code =Success,getMsg =null
2025-08-14 06:40:22,846 [SEATA] [ServerHandlerThread_1_28_500] INFO  org.apache.seata.mockserver.processor.MockRemotingProcessor - process message : BranchCommitResponse{xid='172.18.0.1:8077:9690077789048840', branchId=9690077789048841, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}
2025-08-14 06:40:22,846 [SEATA] [ServerHandlerThread_1_27_500] INFO  org.apache.seata.mockserver.processor.MockOnReqProcessor - sendAsyncResponse: MergeResultMessage GlobalCommitResponse{globalStatus=Committed, resultCode=Success, msg='null'}

2025-08-14 06:40:22,846 [SEATA] [main] INFO  io.seata.MockTest - branch commit(0.6.1) ok, branchId=9690077789048841
2025-08-14 06:40:22,849 [SEATA] [main] INFO  org.apache.seata.core.rpc.netty.NettyServerBootstrap - Shutting server down, the listen port: 8077
2025-08-14 06:40:25,853 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemotingClient - channel inactive: [id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.TmRpcClient - return to pool, tm channel:[id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemotingClient - channel inactive: [id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.NettyPoolableFactory - channel valid false,channel:[id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.RmRpcClient - return to pool, rm channel:[id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.NettyPoolableFactory - will destroy channel:[id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.NettyPoolableFactory - channel valid false,channel:[id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.NettyPoolableFactory - will destroy channel:[id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemoting - ChannelHandlerContext(TmRpcClient#0, [id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]) will closed
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemoting - ChannelHandlerContext(RmRpcClient#0, [id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]) will closed
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_TMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemoting - ChannelHandlerContext(TmRpcClient#0, [id: 0x8eb92a9c, L:/127.0.0.1:55608 ! R:/127.0.0.1:8077]) will closed
2025-08-14 06:40:25,854 [SEATA] [NettyClientSelector_RMROLE_1] INFO  io.seata.core.rpc.netty.AbstractRpcRemoting - ChannelHandlerContext(RmRpcClient#0, [id: 0x91728868, L:/127.0.0.1:55592 ! R:/127.0.0.1:8077]) will closed
Error:  Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 34.404 s <<< FAILURE! - in io.seata.MockTest
Error:  io.seata.MockTest.testRollback  Time elapsed: 30.007 s  <<< ERROR!
io.seata.core.exception.TransactionException: RPC Timeout
	at io.seata.MockTest.doTestRollback(MockTest.java:121)
	at io.seata.MockTest.testRollback(MockTest.java:75)
Caused by: java.util.concurrent.TimeoutException: cost 30000 ms
	at io.seata.MockTest.doTestRollback(MockTest.java:121)
	at io.seata.MockTest.testRollback(MockTest.java:75)

[INFO] 
[INFO] Results:
[INFO] 
Error:  Errors: 
Error:    MockTest.testRollback:75->doTestRollback:121 » Transaction RPC Timeout
[INFO] 
Error:  Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
[INFO] 

This failure is indeed unrelated to this PR, but I’m not sure why the mock server was shut down while running MockTest#doTestRollback.
Shutting server down, the listen port: 8077

@funky-eyes funky-eyes closed this Aug 14, 2025
@funky-eyes funky-eyes reopened this Aug 14, 2025
@jihun4452

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The original flake in ConsulConfigurationTest#testInitSeataConfig should be addressed by this PR.
The remaining failure is from test-old-version / MockTest.testRollback (RPC timeout after server shutdown) and appears unrelated to this change.
If it looks reasonable, could you please re-run the failing matrix job(s)? I’m happy to make any further adjustments if needed.

@funky-eyes funky-eyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
If you're using the DingTalk app, please send your DingTalk account to my email at jianbin@apache.org, and I will invite you to join the Seata developer group

@funky-eyes funky-eyes merged commit 6ee1e5b into apache:2.x Aug 14, 2025
25 of 26 checks passed
@funky-eyes funky-eyes added the first-time contributor first-time contributor label Aug 14, 2025
@funky-eyes

Copy link
Copy Markdown
Contributor

If you're using the DingTalk app, please send your DingTalk account to my email at jianbin@apache.org, and I will invite you to join the Seata developer group

@jihun4452

Copy link
Copy Markdown
Contributor Author

Thanks for the review and merge!
I’m not using DingTalk at the moment.
Is there an alternative way to join the Seata developer group (e.g., mailing list or Slack)?

@funky-eyes

Copy link
Copy Markdown
Contributor

Thanks for the review and merge! I’m not using DingTalk at the moment. Is there an alternative way to join the Seata developer group (e.g., mailing list or Slack)?

You can subscribe to Seata’s dev mailing list by following this guide: https://seata.apache.org/docs/developers/contributor-guide/new-contributor-guide_dev/. You’re also welcome to follow the Seata community’s GitHub repository. Of course, if you’re interested in registering a DingTalk account, that would be even better.

@jihun4452

Copy link
Copy Markdown
Contributor Author

Thanks for sharing the link. I’ll check the mailing list guide and join there. I’ll also follow the Seata GitHub repo to keep up with updates. If possible in the future, I’ll register a DingTalk account as well.

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

first-time contributor first-time contributor module/config config module type: test test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConsulConfigurationTest.testInitSeataConfig(ConsulConfigurationTest.java:121)

2 participants