Skip to content

SOLR-16458: Fix flaky test HealthCheckHandlerTest due to SSL#4247

Open
dsmiley wants to merge 1 commit intoapache:mainfrom
dsmiley:Use-JettyHttpClientNotJdk
Open

SOLR-16458: Fix flaky test HealthCheckHandlerTest due to SSL#4247
dsmiley wants to merge 1 commit intoapache:mainfrom
dsmiley:Use-JettyHttpClientNotJdk

Conversation

@dsmiley
Copy link
Copy Markdown
Contributor

@dsmiley dsmiley commented Mar 29, 2026

Fix test by using the Jetty HttpClient not JDK HttpClient. Our test infra ensures Jetty client is configured when SSL is on (see STCJ4).

I don't think our tests should use JDK HttpClient, unless there's good reason to use that one specifically. I'd rather we simply standardize on the Jetty one, which we use way more.

…r test infra ensures Jetty client is configured when SSL is.
@dsmiley dsmiley requested a review from epugh March 29, 2026 15:29
@github-actions github-actions bot added the tests label Mar 29, 2026
Copy link
Copy Markdown
Contributor Author

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

I have nothing against the JDK HttpClient, but Solr has a major investment in Jetty HttpClient. Like setting up randomized SSL and having it just work. I hate that the mechanism works via a kind of secret static variable backdoor (my characterization of it) that STCJ4 uses but it is what it is.

I did see how we could get an HttpClient configured with SSL to be able to work. I shelved the details if we need to bring it forth -- and we might perhaps for new/better HttpJdkSolrClient tests; who knows. But in the end it felt like it's more trouble than it's worth bothering with. We might consider putting the JDK HttpClient builder in forbidden APIs to guard against accidental use for those not knowing (by people / LLMs).

Maybe I should write all this up into a JIRA to do that.

response.body(),
containsString("FAILURE"));
}
ContentResponse response =
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Instead of creating a client, this PR uses the very new (like hours ago) JettySolrRunner.getSolrClient to return a HttpJettySolrClient. That in turn has getHttpClient -- Jetty based (not JDK) -- obviously.

@dsmiley
Copy link
Copy Markdown
Contributor Author

dsmiley commented Mar 29, 2026

BTW org.apache.solr.crossdc.manager.SolrAndKafkaIntegrationTest#testStrictOrdering has been so friggin flaky that I Ignored it. Already pointed this out a week ago in JIRA but no action yet.

@dsmiley
Copy link
Copy Markdown
Contributor Author

dsmiley commented Mar 30, 2026

This was the seed that reproducibly failed:

./gradlew :solr:core:test --tests "org.apache.solr.handler.admin.HealthCheckHandlerTest.testV1FailureResponseIncludesStatusField" -Ptests.seed=58F0C58B3D8F9C1D

@dsmiley dsmiley changed the title Fix test for SSL by using the Jetty HttpClient not JDK HttpClient. O… SOLR-16458: Fix flaky test HealthCheckHandlerTest due to SSL Mar 30, 2026
@dsmiley
Copy link
Copy Markdown
Contributor Author

dsmiley commented Mar 30, 2026

Some of the test failures here can be seen in CI: https://ci-builds.apache.org/job/Solr/job/Solr-Test-main/13698/

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant