Load sun.internal.new[Class].jar directly to fix CI test failures#1101
Merged
Conversation
`classpathFromResources("sun.internal.new")` uses
`Pattern.compile(artifactName + ".*")` to match against artifact-version
strings in both `META-INF/rewrite/classpath.tsv.gz` type tables and
JAR files under `META-INF/rewrite/classpath/`. Since `.` is a regex
wildcard, the prefix `sun.internal.new` can match unrelated artifacts,
and the static `TypeTable.classesDirByArtifact` cache can cause the
local JAR fallback to be skipped depending on test ordering and what
type tables happen to be on the runtime classpath.
After #1096 routed Maven resolution through Moderne's Artifactory
cache mirror, the four type-attribution-sensitive `IBMSemeruTest`
cases started failing on every scheduled CI run with "LST contains
missing or invalid type information". Loading the JAR directly via
`classpath(Collection<Path>)` and a `getResource` lookup bypasses
both the regex matching and the shared static cache, so the IBM
JSSE stub classes are always available to the parser.
Fixes #1100
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.
Summary
classpathFromResources("sun.internal.new")usesPattern.compile(artifactName + ".*")to match against artifact-version strings; the.chars are regex wildcards, and the staticTypeTable.classesDirByArtifactcache means the local-JAR fallback can be skipped depending on what's on the runtime classpath and which tests have run before.After Route Maven through Moderne Artifactory cache to avoid HTTP 429 #1096 routed Maven through the Moderne Artifactory cache mirror, the four type-attribution-sensitive
IBMSemeruTestcases started failing on every scheduled CI run with "LST contains missing or invalid type information."Switch
IBMSemeruTestandInternalBindPackagesTestto load the JAR directly viaclasspath(Collection<Path>)and agetResourcelookup, bypassing both the regex matching and the shared static cache.Fixes IBMSemeruTest: 4 tests fail in scheduled CI with 'LST contains missing or invalid type information' since Moderne Artifactory mirror was enabled #1100
Test plan
./gradlew test --tests "org.openrewrite.java.migrate.IBMSemeruTest" --tests "org.openrewrite.java.migrate.InternalBindPackagesTest"passes locallyIBMSemeruTestfailures