This is an automated email from the ASF dual-hosted git repository.
paulk-asert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 95283c8e8e possible testlens fix for JDK25
95283c8e8e is described below
commit 95283c8e8ee7c0483f9a42b0f57d9b8bd4e71248
Author: Paul King <[email protected]>
AuthorDate: Mon May 4 21:26:35 2026 +1000
possible testlens fix for JDK25
---
.github/workflows/groovy-build-test.yml | 1 -
.../m12n/ExtensionModuleHelperForTests.groovy | 20 ++++++++++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/groovy-build-test.yml
b/.github/workflows/groovy-build-test.yml
index a0aff0e978..ebca716378 100644
--- a/.github/workflows/groovy-build-test.yml
+++ b/.github/workflows/groovy-build-test.yml
@@ -53,7 +53,6 @@ jobs:
- name: "π Setup Gradle"
uses:
gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
- name: "π Setup TestLens"
- if: matrix.java != 25
uses: testlens-app/setup-testlens@v1
- name: "πTest with Gradle"
run: ./gradlew test -Ptarget.java.home="$JAVA_HOME_${{ matrix.java
}}_${{ runner.arch }}"
diff --git
a/src/test/groovy/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
b/src/test/groovy/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
index f9936137d6..3b2d202016 100644
---
a/src/test/groovy/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
+++
b/src/test/groovy/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
@@ -52,14 +52,23 @@ final class ExtensionModuleHelperForTests {
def ant = new AntBuilder()
def allowed = [
- 'Picked up JAVA_TOOL_OPTIONS: .*',
- 'Picked up _JAVA_OPTIONS: .*'
+ ~/Picked up JAVA_TOOL_OPTIONS: .*/,
+ ~/Picked up _JAVA_OPTIONS: .*/
]
+ def jvmArgs = []
+ if (Runtime.version().feature() == 25) {
+ // JEP 471/498: silence terminal-deprecation warnings for
sun.misc.Unsafe
+ // memory-access methods called from agents on the inherited
classpath
+ // (e.g. testlens's shaded protobuf UnsafeUtil::arrayBaseOffset).
+ // remove when we can - this could mask errors we want to pick up
+ jvmArgs << '--sun-misc-unsafe-memory-access=allow'
+ }
try {
ant.with {
taskdef(name: 'groovyc', classname:
'org.codehaus.groovy.ant.Groovyc')
groovyc(srcdir: baseDir.absolutePath, destdir:
baseDir.absolutePath, includes: 'Temp.groovy', fork: true)
java(classname: 'Temp', fork: 'true', outputproperty: 'out',
errorproperty: 'err') {
+ jvmArgs.each { jvmarg(value: it) }
classpath {
cp.each {
pathelement location: it
@@ -71,8 +80,11 @@ final class ExtensionModuleHelperForTests {
baseDir.deleteDir()
String out = ant.project.properties.out
String err = ant.project.properties.err
- if (err && !allowed.any{ err.trim().matches(it) }) {
- throw new RuntimeException("$err\nClasspath: ${cp.join('\n')}")
+ def stray = err?.readLines()?.findAll { line ->
+ line.trim() && !allowed.any { line ==~ it }
+ } ?: []
+ if (stray) {
+ throw new RuntimeException("${stray.join('\n')}\nClasspath:
${cp.join('\n')}")
}
if (out && (out.contains('FAILURES') || !out.contains('OK'))) {
throw new RuntimeException("$out\nClasspath: ${cp.join('\n')}")