Skip to content

Add a test for broadcast.fail.percent rounding down to a zero threshold - #16519

Open
CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:broadcast-fail-percent-rounding-test
Open

CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:broadcast-fail-percent-rounding-test

Conversation

@CCCLL

@CCCLL CCCLL commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

Follow-up to #16516 (issue #16515), as suggested by @EarthChen in the review of #16516.

  • Adds BroadCastClusterInvokerTest#testFailPercentRoundingDownToZero. The failure threshold is invokers.size() * broadcast.fail.percent / 100, so with four providers and broadcast.fail.percent=10 it is 0, and the broadcast has to stop at the first failed provider, as with a percentage of 0. The test makes the second provider fail, so it also checks that the broadcast does not stop before the first failure, and asserts that the third and fourth providers are not called.
  • Fixes the code comment in BroadcastClusterInvoker that calls the parameter broadcast.fail.threshold. The key is broadcast.fail.percent, and has been since it was added in fix the bug of broadcast cluster invoke #7174.

No behavior change.

Verification

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

Follow-up to apache#16516. The failure threshold is
invokers.size() * broadcast.fail.percent / 100, so with four providers a
percentage of 10 also gives a threshold of 0 and the broadcast has to
stop at the first failed provider, as with a percentage of 0.

Also fix the code comment that calls the parameter
broadcast.fail.threshold; the key is broadcast.fail.percent.
@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.91%. Comparing base (b73b9d1) to head (0e983ae).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16519      +/-   ##
============================================
+ Coverage     60.89%   60.91%   +0.02%     
- Complexity    11753    11761       +8     
============================================
  Files          1953     1953              
  Lines         89278    89278              
  Branches      13475    13475              
============================================
+ Hits          54367    54386      +19     
+ Misses        29329    29313      -16     
+ Partials       5582     5579       -3     
Flag Coverage Δ
integration-tests-java21 32.08% <ø> (+0.01%) ⬆️
integration-tests-java8 32.21% <ø> (+0.02%) ⬆️
samples-tests-java21 32.15% <ø> (+0.01%) ⬆️
samples-tests-java8 29.72% <ø> (-0.04%) ⬇️
unit-tests-java11 59.16% <ø> (+0.03%) ⬆️
unit-tests-java17 58.62% <ø> (+0.02%) ⬆️
unit-tests-java21 58.61% <ø> (+<0.01%) ⬆️
unit-tests-java25 58.60% <ø> (+0.03%) ⬆️
unit-tests-java8 59.13% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants