Skip to content

Conversation

@stagegrowth
Copy link

Background

EquivalentAddressGroup.toString() currently prints the full address list, which can become extremely large and noisy for big address sets. This makes logs and test output hard to read and can obscure useful information.

Changes

This PR adds a hard cap to the number of addresses rendered in toString() and summarizes the remainder (e.g., “... N more”). It also adds focused unit tests to validate the large-list and boundary behaviors, and refactors related CallOptionsTest assertions using a small Truth subject for clearer equivalence checks.

Purpose

Keep toString() output readable even with very large address lists
Ensure the summarization behavior is covered by unit tests
Improve clarity of CallOptions equivalence assertions in tests

Note

The summary threshold is defined as a private constant and is only used for output formatting. It does not change the underlying address data or behavior—only the string representation.

Fixes #12593

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 7, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.


/** Unit tests for {@link CallOptions}. */
@RunWith(JUnit4.class)
public class CallOptionsTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this test seem unrelated to the PR description. Can you move it to a separate PR?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I’ve reverted the CallOptionsTest refactor in this PR since it’s unrelated to the change. I can follow up with a separate PR if we still want that refactor.

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.

Summarize EquivalentAddressGroup.toString() output for large address lists

2 participants