Skip to content

SOLR-18390: remove test-framework HTTP client convenience helpers - #4778

Open
serhiy-bzhezytskyy wants to merge 2 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18390-remove-test-http-client-helpers
Open

SOLR-18390: remove test-framework HTTP client convenience helpers#4778
serhiy-bzhezytskyy wants to merge 2 commits into
apache:mainfrom
serhiy-bzhezytskyy:SOLR-18390-remove-test-http-client-helpers

Conversation

@serhiy-bzhezytskyy

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-18390

Removes the four @Deprecated test-framework HTTP client convenience helpers (SolrTestCaseJ4.getHttpSolrClient overloads and JettySolrRunner.newClient()) and inlines every call site to the equivalent HttpJettySolrClient.Builder construction -- 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 collections getLeader() 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)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant