Skip to content

Conversation

@zhangshenghang
Copy link
Member

The roundRobinLoadBalanceTest method only calls the methods but contains no assertions, making it an ineffective test.

Fix:Add proper assertions to verify

  • Selected upstream is not null
  • Selected upstream is from the provided list
  • Round-robin distribution behavior with equal weights

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@Aias00 Aias00 requested a review from Copilot August 12, 2025 05:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the RoundRobinLoadBalanceTest by adding meaningful assertions to verify load balancer functionality. The existing test method only invoked the select method without any verification, making it ineffective for catching bugs.

Key changes:

  • Add assertions to verify selected upstreams are not null and from the provided list
  • Add round-robin distribution testing with equal weights to verify balanced selection
  • Import additional assertion methods for comprehensive testing

zhangshenghang and others added 3 commits August 12, 2025 14:31
- Introduce SELECTION_ITERATIONS constant to replace magic number 30
- Update test to use the new constant for better readability and maintainability
@loongs-zhang loongs-zhang merged commit 717cbe9 into apache:master Aug 13, 2025
43 checks passed
@Aias00 Aias00 added this to the 2.7.0.2 milestone Aug 17, 2025
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.

3 participants