Skip to content

Quiet test logs, deprecation warning per module - #5355

Merged
janhoy merged 5 commits into
apache:mainfrom
janhoy:quiet-test-logs
Nov 18, 2026
Merged

janhoy merged 5 commits into
apache:mainfrom
janhoy:quiet-test-logs

Conversation

@janhoy

@janhoy janhoy commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-assisted, reviewed by Jan

Five independent build/CI changes that take the bulk of the noise out of our test logs. Measured on the parallel-workflow runs of #5354 (7 workflows, 49 forked test JVMs): of 3742 lines in the Gradle-running steps, 1746 were neither task progress nor test results, and 882 of those came from five message families. For :solr:core the non-signal share drops from 57% to roughly 7%.

  • Grant URLPermission by wildcard host. java.net.HostPortrange normalises a numeric IPv4 authority with a Formatter bound to Locale.US, whose %d conversion needs the CLDR locale provider, which cannot load while the policy file is still being parsed. The parser swallows the error, warns, and silently drops the entry, so the five 127.0.0.1 grants were never in effect; the [::1] ones survive only because the IPv6 branch uses %02x. That is JDK-8305346, won't-fix since the security manager goes away in JDK 24. 490 lines across the Replace Crave with parallel test workflows #5354 runs, ten per forked JVM. No value of java.locale.providers avoids it; a wildcard host parses cleanly and widens nothing, since the SocketPermission grants still confine every connect to loopback.
  • Register JDK events in the test policy. OtelRuntimeJvmMetrics opens a JFR recording stream, and without registerEvent / accessClassInPackage.jdk.{jfr.,}internal.event the JVM logs Could not initialize JDK events. access denied and silently runs without the JFR-sourced jvm.system.cpu.utilization gauge it prefers over JMX. The same three grants are already in solr/server/etc/security.policy.
  • Deprecation warnings on per module. javac's uses or overrides a deprecated API note is mandatory and unsuppressable (-nowarn, -Xlint:none, -Xmaxwarns 0 all keep it). The only cure is to turn the warnings on and have none left, so javac.gradle now keeps a list of clean projects; :solr:api and :solr:solrj are the first two (4 + 9 + 49 warnings fixed or suppressed with a reason). 232 lines on CI; other modules keep the note until cleaned the same way, :solr:core alone has ~332.
  • Cache the Gradle distribution. setup-gradle's gradle-home-cache-includes defaults to caches and notifications, so wrapper/dists was never saved and all 10 jobs re-downloaded the Gradle zip, banner and progress bar included.
  • Move the actions off Node 20. actions/cache v4 and actions/setup-java v4 in the shared composite action were the last two, bumped to the v6 SHAs already used elsewhere in the repo.

Reasoning behind silencing the deprecation logs is that we seldom act on those per test run anyway. It is more realiastic to do a targeted effort to fix deprecations once in a while.

…305346

java.net.URLPermission normalises a numeric IPv4 authority through
java.net.HostPortrange, which formats the address with a Formatter bound to
Locale.US.  The "%d" conversion needs DecimalFormatSymbols, so it has to load
the CLDR locale provider, and that cannot be instantiated while the policy file
is still being parsed.  The policy parser swallows the resulting
ServiceConfigurationError, prints a warning and silently drops the entry, so
the five 127.0.0.1 grants were never in effect.  The [::1] grants survive only
because the IPv6 branch formats with "%02x", which needs no decimal symbols.

On a full parallel CI run 49 forked test JVMs each printed ten lines of this
warning, 490 lines in total.  No setting of java.locale.providers avoids it and
granting AllPermission does not help either; the JDK bug is closed as
won't-fix because the security manager is removed in JDK 24.

A wildcard host parses fine and widens nothing in practice: the
SocketPermission grants a few lines above still confine every connect to
localhost, 127.0.0.1 and [::1].
… security manager

OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics, and the
JVM then wants to register its own JDK event classes.  Without these grants the
JFR subsystem logs

  [warning][jfr,system] Could not initialize JDK events. access denied
  ("java.lang.RuntimePermission" "accessClassInPackage.jdk.internal.event")

and carries on with no JDK events, which silently disables the JFR-sourced
jvm.system.cpu.utilization gauge that OtelRuntimeJvmMetrics deliberately
prefers over JMX.

The same three grants were added to solr/server/etc/security.policy already;
this brings the test policy in line.
With -Xlint:-deprecation javac still prints "uses or overrides a deprecated
API" plus "Recompile with -Xlint:deprecation for details" as a mandatory note,
and nothing suppresses it: not -nowarn, not -Xlint:none, not -Xmaxwarns 0.  The
only way to be rid of it is to turn the warnings on and have none left.

So javac.gradle now keeps a list of projects that compile clean with
-Xlint:deprecation, and :solr:api and :solr:solrj are the first two.  Four
@Schema(required = true) uses move to requiredMode, the hamcrest isIn matchers
become in, and CloudSolrClient.getClusterState() calls go straight to the
cluster state provider the deprecated method delegates to.  The rest are
suppressed with a reason, mostly in tests whose whole point is to cover the
deprecated API.

Generated request classes write to model fields that may be deprecated, so the
setter in the Mustache template suppresses it too.

Other modules keep the note until they are cleaned up the same way; :solr:core
alone still has around 332 warnings.
setup-gradle's gradle-home-cache-includes defaults to caches and notifications only, so the wrapper's distribution directory is never saved and every job downloads the Gradle zip again, printing the download and the welcome banner.
actions/cache v4 and actions/setup-java v4 in the shared composite action were the last two still targeting Node 20, so every job was warned that the runner forces them onto a newer Node. Both majors are already in use elsewhere in the repo; this brings the composite action in line.

@epugh epugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread gradle/java/javac.gradle

// Configure Java project defaults.

// Projects that compile free of deprecation warnings and so can keep -Xlint:deprecation on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I;'ve been mulling over creating a JIRA with subtasks per deprecation in hopes that folks would move on them... it's been annoying!

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.

Yes, and with this deprecationLintProjects someone can embrace a module, getting it deprecation free and add it to that list...

permission "java.net.URLPermission" "https://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*";
permission "java.net.URLPermission" "socket://127.0.0.1:*", "CONNECT:*";
// JDK-8305346: a URLPermission with a numeric IPv4 host cannot be parsed while the policy is
// bootstrapping, so such a grant is dropped with a warning; the SocketPermissions above are what

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shorten, but yeah.

@Schema(description = "The version string for this package version.", required = true)
@Schema(
description = "The version string for this package version.",
requiredMode = Schema.RequiredMode.REQUIRED)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yep, saw this recently too!

}

@Test
@SuppressWarnings("deprecation") // covers the deprecated ping()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, when we deprecate something we need to be better about removing it from main so it doesn't linger.

@dsmiley dsmiley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1
I'd rather see separate PRs per issue where a matter repeats in many places instead of one but I'm not bothered enough.


// Track request counts on each node before query calls
ClusterState clusterState = cluster.getSolrClient().getClusterState();
ClusterState clusterState = cluster.getSolrClient().getClusterStateProvider().getClusterState();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this deserves a cluster.getClusterState() if there isn't one already

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.

@janhoy
janhoy marked this pull request as ready for review November 18, 2026 15:25
@janhoy
janhoy merged commit bef45ad into apache:main Nov 18, 2026
8 of 9 checks passed
@janhoy
janhoy deleted the quiet-test-logs branch November 18, 2026 15:29
@github-actions

Copy link
Copy Markdown

Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).

Consider enabling Allow edits from maintainers so Solr maintainers can contribute to this branch (optional).

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.

3 participants