SOLR-18390: remove test-framework HTTP client convenience helpers - #4778
Open
serhiy-bzhezytskyy wants to merge 2 commits into
Open
SOLR-18390: remove test-framework HTTP client convenience helpers#4778serhiy-bzhezytskyy wants to merge 2 commits into
serhiy-bzhezytskyy wants to merge 2 commits into
Conversation
Removes the four @deprecated helpers (SolrTestCaseJ4.getHttpSolrClient overloads and JettySolrRunner.newClient()) and inlines every call site to the equivalent HttpJettySolrClient.Builder construction. Test-only change, no behavior change.
The mechanical migration called .getLeader() separately for getBaseUrl() and getCoreName(). For PRS collections getLeader() recomputes the leader on every call (its own comment: 'leader may keep changing') -- calling it twice risked getBaseUrl() and getCoreName() coming from two different replicas if the leader changed in between. Capture it once instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18390
Removes the four
@Deprecatedtest-framework HTTP client convenience helpers (SolrTestCaseJ4.getHttpSolrClientoverloads andJettySolrRunner.newClient()) and inlines every call site to the equivalentHttpJettySolrClient.Builderconstruction -- matching what the deprecated methods' own bodies did. Test-only change, no changelog.84 files, 173 call sites migrated. While migrating, found and fixed a subtle bug the mechanical inlining would otherwise have introduced: several sites called
Slice.getLeader()twice (once for the URL, once for the collection name). For PRS collectionsgetLeader()recomputes the leader on every call, so calling it twice could return two different replicas if the leader changed in between. Fixed by capturing it once.Ran the highest call-site-density test classes plus everything touched by the getLeader() fix, all green (0 failures): FullSolrCloudDistribCmdsTest, AliasIntegrationTest, TestCoordinatorRole, LB2SolrClientTest, TestPullReplica (nightly), TestPullReplicaErrorHandling, TestPullReplicaWithAuth, TestTlogReplica, HealthCheckHandlerTest, MultiAuthPluginTest, BasicAuthIntegrationTest, HttpSolrClientBadInputTest, TestJettySolrRunner, BasicDistributedZkTest, BasicDistributedZk2Test.
AI-assisted (Claude Sonnet 5)