Fix CLDR locale adapter warnings during test security policy loading#39
Draft
Copilot wants to merge 2 commits into
Draft
Fix CLDR locale adapter warnings during test security policy loading#39Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Set java.locale.providers=COMPAT,CLDR system property for all test JVMs in defaults-tests.gradle. When the security policy file loads java.net.URLPermission entries, the JVM triggers locale service loading; on CI runners where the CLDR adapter cannot be instantiated, this produces recurring warnings. Setting COMPAT first (always available) with CLDR as fallback eliminates the ServiceConfigurationError without removing any URLPermission entries or suppressing stderr. Agent-Logs-Url: https://github.com/epugh/solr/sessions/96f27172-f48c-4ebe-955c-1dad3584a343 Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recurring CI log warnings and errors
Fix CLDR locale adapter warnings during test security policy loading
May 5, 2026
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.
On CI runners with minimal JDK builds, every test JVM process emits one warning per
java.net.URLPermissionentry in the security policy file:URLPermissioninstantiation triggers locale service loading; when the CLDR adapter isn't available, policy loading fails silently for each of the 14URLPermissionentries (those permissions are dropped) and the warnings flood the log.Change
gradle/testing/defaults-tests.gradle: Addjava.locale.providers=COMPAT,CLDRas a system property for all test JVMs.COMPATis always available in any standard JDK and handles the locale lookup before CLDR is attempted, eliminating the instantiation failure. CLDR remains as a fallback for tests that rely on CLDR-formatted data.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
develocity.apache.org/usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -XX:ReservedCodeCacheSize=256m -XX:TieredStopAtLevel=1 -XX:+UseParallelGC -XX:ActiveProcessorCount=1 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Create a pull request in
epugh/solr(base branchmain) to address recurring CI log warnings/errors:java.util.ServiceConfigurationError: Locale provider adapter "CLDR" cannot be instantiated.java.security.policy: error adding Permission, java.net.URLPermission:Context:
.github/workflows/tests-via-crave.ymlTask requirements:
testtask does not emit these warnings (or they are properly handled), without simply silencing stderr. Prefer correcting the underlying configuration.java.locale.providersfor test JVMs if appropriate.java.security.policyURLPermission warnings, locate the policy file / permission additions and correct the syntax/format or remove invalid entries../gradlew testpasses.Deliverables:
Notes:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failing job is ultimately caused by test failures, not by the earlier locale/policy noise in the log.
What failed
From the job log (ref
bf5d71c09ae80527c794c5f006ccc9637663d3dc)::solr:solrj:test (FAILURE)with failing test:org.apache.solr.client.solrj.impl.LB2SolrClientTest.testTwoServersThe repeated
java.util.ServiceConfigurationError: Locale provider adapter "CLDR" cannot be instantiatedmessages appear, but the job is marked failed specifically because of failing Gradle test tasks.
Root cause (most likely)
LB2SolrClientTest.testTwoServers()is timing-sensitive and relies on log-based coordination to detect that the “alive check” ran:(see
startJettyAndWaitForAliveCheckQuery, lines 276–284 insolr/solrj/src/test/.../LB2SolrClientTest.java, refbf5d71c09ae80527c794c5f006ccc9637663d3dc)This is fragile because:
So the test can fail even when functionality is correct.
Fix: make the test wait on behavior, not logs
Change
startJettyAndWaitForAliveCheckQueryto verify recovery by retrying an actual query until it succeeds, instead of asserting a specific log line appears within 10 seconds.Suggested patch (drop log dependency, use retry on query result)
In
LB2SolrClientTest.java:Then update callers:
and:
This keeps the intent (“server comes back and LB client eventually uses it”) while removing the flakiness introduced by log timing.
Minimal alternative (if you want to keep log-based check)
If you prefer minimal change, increase the timeout and reduce brittleness:
pollMessage(10, ...)to something like `pollMessage(3...This pull request was created from Copilot chat.