Version in base suite: 7.5.1+1+ds1-3 Base version: jtreg7_7.5.1+1+ds1-3 Target version: jtreg7_7.5.2+1+ds2-3~deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/j/jtreg7/jtreg7_7.5.1+1+ds1-3.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/j/jtreg7/jtreg7_7.5.2+1+ds2-3~deb13u1.dsc CHANGELOG.md | 15 debian/changelog | 69 + debian/control | 3 debian/copyright | 5 debian/jtreg7.lintian-overrides | 6 debian/patches/codetools-7904101-proposed.patch | 411 ++++++++++ debian/patches/codetools-7904104-proposed.patch | 35 debian/patches/codetools-7904105-proposed.patch | 42 + debian/patches/codetools-7904106-proposed.patch | 75 + debian/patches/codetools-7904107-proposed.patch | 38 debian/patches/codetools-7904152.patch | 73 + debian/patches/codetools-7904157-proposed.patch | 18 debian/patches/flush-alarm.patch | 15 debian/patches/preview-test.patch | 31 debian/patches/reproducible-build.patch | 2 debian/patches/series | 8 debian/patches/testng-build-with-gradle.patch | 3 debian/picocli/maven.rules | 2 debian/source/lintian-overrides | 16 debian/watch | 6 make/Defs.gmk | 4 make/Makefile | 4 make/Rules.gmk | 24 make/build-support/version-numbers | 2 make/jtdiff.gmk | 4 make/jtreg.gmk | 26 src/share/classes/com/sun/javatest/diff/Help.java | 5 src/share/classes/com/sun/javatest/diff/i18n.properties | 4 src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java | 26 src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java | 7 src/share/classes/com/sun/javatest/regtest/config/TestProperties.java | 12 src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java | 31 src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java | 65 + src/share/classes/com/sun/javatest/regtest/tool/Help.java | 3 src/share/classes/com/sun/javatest/regtest/tool/i18n.properties | 4 src/share/doc/javatest/regtest/tag-spec.html | 11 test/4499340/T4499340.gmk | 4 test/6783087/T6783087.gmk | 4 test/SecurityManager/SecurityManagerTests.gmk | 6 test/TestWhiteSpaceFiles.gmk | 4 test/agentout/AgentOut.gmk | 4 test/autovm/AutoVMTests.gmk | 4 test/badgroups/BadGroups.gmk | 6 test/basic/Basic.gmk | 8 test/bootclasspath/BootClassPathTest.gmk | 4 test/buildPatternTest/BuildPatternTest.gmk | 4 test/buildTag/BuildTagTest.gmk | 4 test/classDirs/ClassDirsTest.gmk | 4 test/classIsolation/ClassIsolationTest.gmk | 10 test/compileArgFileTest/CompileArgFileTest.gmk | 4 test/cpappend/CPAppendTests.gmk | 4 test/exclude/ExcludeTest.gmk | 4 test/groups/GroupTest.gmk | 6 test/groups2/Group2Test.gmk | 6 test/i18n/i18n.com.sun.javatest.diff.gmk | 4 test/i18n/i18n.com.sun.javatest.regtest.gmk | 8 test/ignoreTag/IgnoreTagTest.gmk | 8 test/ignoresymbolfile/IgnoreSymbolFileTest.gmk | 4 test/interrupt/RunInterrupt.gmk | 8 test/javacVMOptions/Test.java | 6 test/jdkModulesTest/JDKModulesTest.gmk | 4 test/jdkOptsTest/JDKOptsTest.gmk | 8 test/jdkVersion/JDKVersionTest.gmk | 6 test/junit/JUnitLibTest.gmk | 4 test/junitTrace/JUnitTrace.gmk | 4 test/junitTrace/JupiterTempDir.java | 53 + test/keywords/testKeywords.gmk | 8 test/libBuildArgs/LibBuildArgsTest.gmk | 6 test/libBuildArgs/lib/LIBRARY.properties | 1 test/libdirs/LibDirsTest.gmk | 4 test/match/MatchTest.gmk | 4 test/modlibs/ModLibsTest.gmk | 7 test/modlibs/compileAction/patch/CompilePatch.java | 3 test/modlibs/compileAction/patch/java.base/java/io/IOHelper2.jasm | 29 test/modlibs/expect-classes.txt | 1 test/modules/ModulesTest.gmk | 8 test/optionDecoder/OptionDecoderTest.gmk | 4 test/osTest/OSTest.gmk | 4 test/preview/PreviewTest.gmk | 12 test/preview/TEST.ROOT | 4 test/previewLeaking/TEST.ROOT | 3 test/previewLeaking/TestPreviewLeaking.gmk | 42 + test/previewLeaking/lib/Lib.java | 24 test/previewLeaking/tag/PreviewTest.java | 58 + test/rerun2/RerunTest2.gmk | 4 test/sanityTest/SanityTest.gmk | 4 test/shell/testShell.gmk | 4 test/smartActionArgs/SmartActionArgs.gmk | 8 test/smartActionArgs/optAuto/Test.java | 4 test/smartActionArgs/optAuto/Test2.java | 4 test/smartActionArgs/optAuto/Test3.java | 39 test/smartActionArgs/optIn/Test3.java | 39 test/smartActionArgs/optOut/Test3.java | 35 test/statusFilter/StatusFilterTest.gmk | 4 test/testng-junit/TestNGJUnitTest.gmk | 4 test/testng/TestNGLibTest.gmk | 4 test/testprops/TestPropsTest.gmk | 4 test/timeoutDefaultSeconds/TEST.ROOT | 1 test/timeoutDefaultSeconds/TimeoutDefaultSeconds.gmk | 42 + test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java | 43 + test/timeoutDefaultSeconds/junit/JUnitTimeoutDefaultSecondsWaiter.java | 34 test/timeoutDefaultSeconds/junit/TEST.properties | 2 test/timeoutDefaultSeconds/one/TEST.properties | 1 test/timeoutDefaultSeconds/one/TimeoutDefaultSecondsWaiter.java | 37 test/timeoutHandler/TimeoutHandlerTimeoutTest.gmk | 4 test/verifyexclude/VerifyExcludeTest.gmk | 28 test/versionCheck/TestVersionCheck.gmk | 6 testng/testng-core/src/main/java/org/testng/Converter.java | 88 -- testng/testng-core/src/main/java/org/testng/internal/Yaml.java | 394 --------- testng/testng-core/src/main/java/org/testng/internal/YamlParser.java | 26 testng/testng-core/src/main/resources/META-INF/services/org.testng.xml.ISuiteParser | 1 testng/testng-core/src/test/java/test/yaml/YamlTest.java | 96 -- 112 files changed, 1644 insertions(+), 850 deletions(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmptmf8iudi/jtreg7_7.5.1+1+ds1-3.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmptmf8iudi/jtreg7_7.5.2+1+ds2-3~deb13u1.dsc: no acceptable signature found diff -Nru jtreg7-7.5.1+1+ds1/CHANGELOG.md jtreg7-7.5.2+1+ds2/CHANGELOG.md --- jtreg7-7.5.1+1+ds1/CHANGELOG.md 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/CHANGELOG.md 2025-10-28 19:26:35.000000000 +0000 @@ -1,7 +1,20 @@ -## [Unreleased](https://git.openjdk.org/jtreg/compare/jtreg-7.5.1+1...master) +## [Unreleased](https://git.openjdk.org/jtreg/compare/jtreg-7.5.2+1...master) _nothing noteworthy, yet_ +## [7.5.2](https://git.openjdk.org/jtreg/compare/jtreg-7.5.1+1...jtreg-7.5.2+1) + +* Support `${test.main.class}` for Java source files in smart arguments [CODETOOLS-7903981](https://bugs.openjdk.org/browse/CODETOOLS-7903981) + +* Make default timeout seconds configurable [CODETOOLS-7903961](https://bugs.openjdk.org/browse/CODETOOLS-7903961) + +* Restore propagation of preview flag into library code [CODETOOLS-7903971](https://bugs.openjdk.org/browse/CODETOOLS-7903971) + +* Add support for `.jasm` and `.jcod` file in patched modules [CODETOOLS-7903955](https://bugs.openjdk.org/browse/CODETOOLS-7903955) + +* Use scratch directory for JUnit's `@TempDir` annotation by default [CODETOOLS-7903953](https://bugs.openjdk.org/browse/CODETOOLS-7903953) + + ## [7.5.1](https://git.openjdk.org/jtreg/compare/jtreg-7.5+1...jtreg-7.5.1+1) * Support running individual parameterized tests and @Nested test classes [CODETOOLS-7903930](https://bugs.openjdk.org/browse/CODETOOLS-7903930) diff -Nru jtreg7-7.5.1+1+ds1/debian/changelog jtreg7-7.5.2+1+ds2/debian/changelog --- jtreg7-7.5.1+1+ds1/debian/changelog 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/changelog 2026-04-26 11:07:12.000000000 +0000 @@ -1,3 +1,72 @@ +jtreg7 (7.5.2+1+ds2-3~deb13u1) trixie-security; urgency=medium + + * Rebuild for trixie, needed by the latest OpenJDK 21 security release + + -- Moritz Mühlenhoff Sun, 26 Apr 2026 13:07:12 +0200 + +jtreg7 (7.5.2+1+ds2-3) unstable; urgency=medium + + * d/p/codetools-7904157-proposed.patch: override compile + timeout to resolve the test failure due to the compilation + timing out with the default timeout (Closes: #1128796). + + -- Vladimir Petko Mon, 23 Feb 2026 17:42:54 +1300 + +jtreg7 (7.5.2+1+ds2-2) unstable; urgency=medium + + * d/p/codetools-7904152.patch: skip security policy tests + with Java 25 (CODETOOLS-7904152). + + -- Vladimir Petko Mon, 16 Feb 2026 10:53:39 +1300 + +jtreg7 (7.5.2+1+ds2-1) unstable; urgency=medium + + * d/{control, copyright,p/testng-build-with-gradle.patch}: drop + snakeyaml dependency (Closes: #1117950). + * Add patches to resolve test ftbfs (Closes: #1115694): + - d/p/codetools-7904101.patch: capture all stdout/stderr output + from the agent vm to the log file. + - d/p/codetools-7904104-proposed.patch: do not interrupt main + thread if the agent process is killed. + - d/p/codetools-7904105-proposed.patch: synchronize test result + updates. + - d/p/codetools-7904106-proposed.patch: use different work + directories for TestNativePath. + - d/p/codetools-7904107-proposed.patch: add a separate target to + filter log files. + * d/flush_stream.patch: drop patch, it is replaced by + d/p/codetools-7904101.patch. + * d/watch: update repack version. + + -- Vladimir Petko Thu, 23 Oct 2025 08:54:01 +1300 + +jtreg7 (7.5.2+1+ds1-2) unstable; urgency=medium + + * d/copyright: revert FSF address change. + * d/s/lintian-overrides, d/jtreg7.lintian-overrides: add override for + the old FSF address. + + -- Vladimir Petko Thu, 21 Aug 2025 08:17:51 +1200 + +jtreg7 (7.5.2+1+ds1-1) unstable; urgency=medium + + [ Vladimir Petko ] + * New upstream release 7.5.2+1. + - d/watch: set major jtreg version to 7, update junit5 download + url. + - refresh patches. + - d/picocli/maven.rules: replace groovy version with 'debian'. + - d/p/preview-test.patch: enable --enable-preview tests for + Java > 11. + * d/control: update Standards Version to 4.7.2 (no changes). + * Add lintian overrides. + * d/copyright: update FSF address. + + [ tony mancill ] + * Add flush-alarm.patch + + -- Vladimir Petko Mon, 04 Aug 2025 10:39:03 +1200 + jtreg7 (7.5.1+1+ds1-3) unstable; urgency=medium * d/t/self-test: pass JAVA_SPECIFICATION_VERSION to make to fix diff -Nru jtreg7-7.5.1+1+ds1/debian/control jtreg7-7.5.2+1+ds2/debian/control --- jtreg7-7.5.1+1+ds1/debian/control 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/control 2026-02-23 04:42:48.000000000 +0000 @@ -34,7 +34,6 @@ libmaven-shade-plugin-java, libassertj-core-java, libjtharness-java (>= 6.0), - libyaml-snake-java, libfindbugs-java, libbsh-java, libasm-java, @@ -42,7 +41,7 @@ libmaven-plugin-tools-java, libplexus-component-metadata-java, libxbean-java, -Standards-Version: 4.6.2 +Standards-Version: 4.7.2 Vcs-Git: https://salsa.debian.org/java-team/jtreg7.git Vcs-Browser: https://salsa.debian.org/java-team/jtreg7 Homepage: https://openjdk.java.net/jtreg diff -Nru jtreg7-7.5.1+1+ds1/debian/copyright jtreg7-7.5.2+1+ds2/debian/copyright --- jtreg7-7.5.1+1+ds1/debian/copyright 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/copyright 2026-02-23 04:42:48.000000000 +0000 @@ -45,6 +45,11 @@ .gitattributes .github/* gradle/* + testng-core/src/main/java/org/testng/internal/Yaml.java + testng-core/src/test/java/test/yaml/YamlTest.java + testng-core/src/main/java/org/testng/Converter.java + testng-core/src/main/java/org/testng/internal/YamlParser.java + testng-core/src/main/resources/META-INF/services/org.testng.xml.ISuiteParser Upstream-Name: jtreg Source: https://github.com/openjdk/jtreg/ diff -Nru jtreg7-7.5.1+1+ds1/debian/jtreg7.lintian-overrides jtreg7-7.5.2+1+ds2/debian/jtreg7.lintian-overrides --- jtreg7-7.5.1+1+ds1/debian/jtreg7.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/jtreg7.lintian-overrides 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,6 @@ +# libhamscrest-java packaging license d/copyright contains +# symlink. The license information copied verbatim. +jtreg7 binary: copyright-refers-to-symlink-license usr/share/common-licenses/GPL + +# jtreg uses old style GPL license +jtreg7 binary: old-fsf-address-in-copyright-file diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904101-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904101-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904101-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904101-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,411 @@ +Description: intermittent failure in StreamsTest.agentvm.ok + FileDescriptor test intermittently fails because the agent's process output + capture lacks synchronisation. + This PR fixes the issue: + - Agent VM prints the "process output separator" to stderr and stdout + before and after the action. + - The main vm uses the marker to stop reading the stream for the current + test result section (or a general agent log). + - The main vm restarts reading the log after updating the test section (or clearing it) + until the next marker or the process is shut down. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/295 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904101 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- /dev/null ++++ b/src/share/classes/com/sun/javatest/regtest/agent/AgentProcessLogger.java +@@ -0,0 +1,149 @@ ++/* ++ * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Oracle designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Oracle in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++package com.sun.javatest.regtest.agent; ++ ++import java.io.BufferedReader; ++import java.io.IOException; ++import java.io.InputStreamReader; ++import java.io.PrintWriter; ++import java.util.Map; ++import java.util.concurrent.ExecutionException; ++import java.util.concurrent.ExecutorService; ++import java.util.concurrent.Executors; ++import java.util.concurrent.Future; ++import java.util.concurrent.TimeUnit; ++import java.util.concurrent.TimeoutException; ++import java.util.function.BiConsumer; ++import java.util.function.Function; ++ ++/** ++ * Handles stdout/stderr process output from the agent. ++ */ ++public class AgentProcessLogger { ++ ++ /** ++ * Constructs a thread pool to handle agent process output ++ * and creates stdout and stderr readers ++ * ++ * @param p agent process ++ */ ++ public AgentProcessLogger(Process p) { ++ executorService = Executors.newFixedThreadPool(2, runnable -> { ++ Thread th = new Thread(runnable); ++ th.setDaemon(true); ++ return th; ++ }); ++ stdOut = new BufferedReader(new InputStreamReader(p.getInputStream())); ++ stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream())); ++ } ++ ++ /** ++ * Starts logging output and error streams to the specified consumer ++ * ++ * @param logConsumer log consumer, has two parameters - stream name and ++ * the log line ++ */ ++ public void startLogging(BiConsumer logConsumer, ++ Map processStreamWriters, ++ Function mappingFunction) { ++ if (inputDone != null || errorDone != null) { ++ throw new RuntimeException("call stopLogging first"); ++ } ++ if (processStreamWriters != null) { ++ processStreamWriters.computeIfAbsent("stdout", mappingFunction); ++ processStreamWriters.computeIfAbsent("stderr", mappingFunction); ++ } ++ inputDone = executorService.submit(() -> captureLog("stdout", stdOut, logConsumer)); ++ errorDone = executorService.submit(() -> captureLog("stderr", stdErr, logConsumer)); ++ } ++ ++ ++ /** ++ * Waits for the logging tasks to finish ++ * ++ * @param timeout shutdown timeout ++ * @param timeUnit shutdown time unit ++ * ++ * @throws ExecutionException the logger threw an unexpected exception ++ * @throws InterruptedException the logger was interrupted ++ * @throws TimeoutException logging task failed to stop within 60 seconds ++ */ ++ public void stopLogging(int timeout, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException { ++ inputDone.get(timeout, timeUnit); ++ errorDone.get(timeout, timeUnit); ++ inputDone = null; ++ errorDone = null; ++ } ++ ++ /** ++ * Wait for logging tasks to finish and shutdown the thread pool ++ * ++ * @param timeout shutdown timeout ++ * @param timeUnit shutdown time unit ++ */ ++ public void shutdown(int timeout, TimeUnit timeUnit) { ++ try { ++ stopLogging(timeout, timeUnit); ++ } catch (ExecutionException | InterruptedException | TimeoutException ex) { ++ // ignore exception, the process is terminating ++ } ++ executorService.shutdown(); ++ } ++ ++ /** ++ * Forward log lines to the consumer, stop forwarding on the separator ++ * line ++ * ++ * @param streamName name of the stream ++ * @param reader process's stream reader ++ */ ++ private Void captureLog(String streamName, BufferedReader reader, BiConsumer consumer) { ++ try { ++ String line; ++ while ((line = reader.readLine()) != null) { ++ int endMarker = line.indexOf(AgentServer.PROCESS_OUTPUT_SEPARATOR); ++ if (endMarker < 0) { ++ consumer.accept(streamName, line); ++ continue; ++ } ++ if (endMarker > 0) { ++ line = line.substring(0, endMarker); ++ consumer.accept(streamName, line); ++ } ++ break; ++ } ++ } catch (IOException ex) { ++ // ignore the exception, the reader might be closed ++ } ++ return null; ++ } ++ ++ private final ExecutorService executorService; ++ private final BufferedReader stdOut; ++ private final BufferedReader stdErr; ++ private Future inputDone; ++ private Future errorDone; ++} +--- a/src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java ++++ b/src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java +@@ -30,9 +30,11 @@ + import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.File; ++import java.io.FileDescriptor; + import java.io.FileWriter; + import java.io.IOException; + import java.io.OutputStream; ++import java.io.OutputStreamWriter; + import java.io.PrintStream; + import java.io.PrintWriter; + import java.io.Writer; +@@ -93,6 +95,9 @@ + public static final byte KEEPALIVE = 5; + public static final byte CLOSE = 6; + ++ public static final String PROCESS_OUTPUT_SEPARATOR = ++ "------ This line is the stdout/stderr output separator ------"; ++ + /** + * Send KEEPALIVE bytes periodically to a stream. + * The bytes are written every {@code WRITE_TIMEOUT} milliseconds. +@@ -236,6 +241,7 @@ + try { + int op; + while ((op = in.read()) != -1) { ++ writeProcessOutputSeparator(); + switch (op) { + case DO_COMPILE: + doCompile(); +@@ -252,6 +258,8 @@ + throw new Error("Agent.Server: unexpected op: " + op); + } + out.flush(); ++ // signal end of section output for the log writer ++ writeProcessOutputSeparator(); + } + } finally { + keepAlive.finished(); +@@ -260,6 +268,20 @@ + } + } + ++ private void writeProcessOutputSeparator() { ++ try { ++ processStdOut.write(PROCESS_OUTPUT_SEPARATOR); ++ processStdOut.write(System.lineSeparator()); ++ processStdOut.flush(); ++ processStdErr.write(PROCESS_OUTPUT_SEPARATOR); ++ processStdErr.write(System.lineSeparator()); ++ processStdErr.flush(); ++ } ++ catch (IOException e ){ ++ // ignore exception as the agent process may be killed ++ } ++ } ++ + private void doCompile() throws IOException { + if (traceServer) { + traceOut.println("Agent.Server.doCompile"); +@@ -388,7 +410,8 @@ + private final PrintWriter logWriter; + private final int id; + private final Map writers = new EnumMap<>(OutputKind.class); +- ++ private final OutputStreamWriter processStdOut = new FileWriter(FileDescriptor.out); ++ private final OutputStreamWriter processStdErr = new FileWriter(FileDescriptor.err); + /** + * Create an output stream for output to be sent back to the client via the server connection. + * @param kind the kind of stream +--- a/src/share/classes/com/sun/javatest/regtest/exec/Agent.java ++++ b/src/share/classes/com/sun/javatest/regtest/exec/Agent.java +@@ -26,15 +26,12 @@ + package com.sun.javatest.regtest.exec; + + +-import java.io.BufferedReader; + import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.EOFException; + import java.io.File; + import java.io.FileWriter; + import java.io.IOException; +-import java.io.InputStream; +-import java.io.InputStreamReader; + import java.io.PrintStream; + import java.io.PrintWriter; + import java.lang.reflect.Method; +@@ -60,13 +57,16 @@ + import java.util.TreeSet; + import java.util.WeakHashMap; + import java.util.concurrent.CountDownLatch; ++import java.util.concurrent.ExecutionException; + import java.util.concurrent.TimeUnit; ++import java.util.concurrent.TimeoutException; + + import com.sun.javatest.Status; + import com.sun.javatest.TestResult; + import com.sun.javatest.WorkDirectory; + import com.sun.javatest.regtest.TimeoutHandler; + import com.sun.javatest.regtest.agent.ActionHelper; ++import com.sun.javatest.regtest.agent.AgentProcessLogger; + import com.sun.javatest.regtest.agent.AgentServer; + import com.sun.javatest.regtest.agent.Alarm; + import com.sun.javatest.regtest.agent.Flags; +@@ -164,8 +164,8 @@ + env.putAll(envVars); + agentServerProcess = process = pb.start(); + agentServerPid = ProcessUtils.getProcessId(process); +- copyAgentProcessStream("stdout", process.getInputStream()); +- copyAgentProcessStream("stderr", process.getErrorStream()); ++ processLogger = new AgentProcessLogger(process); ++ startAgentLog(); + + try { + final int ACCEPT_TIMEOUT = (int) (60 * 1000 * timeoutFactor); +@@ -202,29 +202,11 @@ + } + + /** +- * Reads the output written by an agent process, and copies it either to +- * the current TestResult object (when one is available) or to the agent's +- * log file, if output is found while there is no test using the agent. +- * +- * @param name the name of the stream +- * @param in the stream ++ * Writes process input and error stream to the agent log. + */ +- void copyAgentProcessStream(final String name, final InputStream in) { +- Thread t = new Thread() { +- @Override +- public void run() { +- try (BufferedReader inReader = new BufferedReader(new InputStreamReader(in))) { +- String line; +- while ((line = inReader.readLine()) != null) { +- handleProcessStreamLine(name, line); +- } +- } catch (IOException e) { +- // ignore +- } +- } +- }; +- t.setDaemon(true); +- t.start(); ++ private void startAgentLog() { ++ processLogger.startLogging( (String stream, String logLine) -> log(stream + ": " + logLine), ++ null, null); + } + + /** +@@ -258,30 +240,24 @@ + * + * @param section the test result section to be used, or {@code null} + */ +- private synchronized void captureProcessStreams(TestResult.Section section) { ++ private synchronized void captureProcessStreams(TestResult.Section section, int timeout, TimeUnit timeUnit) ++ throws InterruptedException, ExecutionException, TimeoutException { ++ processLogger.stopLogging(timeout, timeUnit); + currentTestResultSection = section; + if (currentTestResultSection == null) { + for (PrintWriter pw : processStreamWriters.values()) { + pw.close(); + } + processStreamWriters.clear(); +- } +- } +- +- /** +- * Saves a line of output that was written by the agent to stdout (fd1) or stderr (fd2). +- * If there is a current test result section, the line is saved there; +- * otherwise it is written to the agent log file. +- * +- * @param name the name of the stream from which the line was read +- * @param line the line that was read +- */ +- private synchronized void handleProcessStreamLine(String name, String line) { +- if (currentTestResultSection == null) { +- log(name + ": " + line); ++ startAgentLog(); + } else { +- processStreamWriters.computeIfAbsent(name, currentTestResultSection::createOutput) +- .println(line); ++ processLogger.startLogging((String name, String line) -> { ++ Objects.requireNonNull(currentTestResultSection); ++ Objects.requireNonNull(processStreamWriters); ++ Objects.requireNonNull(name); ++ Objects.requireNonNull(line); ++ processStreamWriters.get(name).println(line); ++ }, processStreamWriters, currentTestResultSection::createOutput); + } + } + +@@ -391,17 +367,25 @@ + } + keepAlive.setEnabled(false); + try { +- captureProcessStreams(trs); + synchronized (out) { + agentAction.send(); + } + trace(actionName + ": request sent"); +- return readResults(trs); +- } catch (IOException e) { ++ // The agent sends process output separator in response ++ // to receiving a command. Wait for the separator and ++ // redirect log to the test result section ++ captureProcessStreams(trs, timeout, TimeUnit.SECONDS); ++ Status aResult = readResults(trs); ++ // The agent will be disposed on exception. ++ // Reset the agent log only if the agent can be reused. ++ // The agent will send process output separator on ++ // command execution. ++ captureProcessStreams(null, timeout, TimeUnit.SECONDS); ++ return aResult; ++ } catch (InterruptedException | TimeoutException | ExecutionException | IOException e) { + trace(actionName + ": error " + e); + throw new Fault(e); + } finally { +- captureProcessStreams(null); + alarm.cancel(); + keepAlive.setEnabled(true); + if (alarm.didFire()) { +@@ -486,7 +470,9 @@ + alarm.cancel(); + Thread.interrupted(); // clear any interrupted status + } +- ++ // Ensure that thread pool threads are shut down ++ // and the agent log is fully written ++ processLogger.shutdown(60, TimeUnit.SECONDS); + log("Closed"); + } + +@@ -618,6 +604,7 @@ + final List vmOpts; + final File execDir; + final Process process; ++ final AgentProcessLogger processLogger; + final DataInputStream in; + final DataOutputStream out; + final KeepAlive keepAlive; diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904104-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904104-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904104-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904104-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,35 @@ +Description: intermittent test failure in TimeoutDefaultSecondsWaiter + victim.interrupt() is not needed if the process exits successfully + after the kill signal. This PR only calls interrupt() if the process + fails to exit or the wait is interrupted for some reason. + This allows TimeoutDefaultSecondsWaiter tests to pass. + Alternative: update assertion in TimeoutDefaultSecondsWaiter test. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/296 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904104 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java ++++ b/src/share/classes/com/sun/javatest/regtest/exec/ProcessCommand.java +@@ -329,9 +329,17 @@ public void run() { + + timeoutHandlerDone.countDown(); + +- // JDK 1.8 introduces a Process.waitFor(timeout) method which could +- // be used here. We need run on 1.5 so using interrupt() instead. +- victim.interrupt(); ++ // unlock the main thread if the process fails ++ // to exit ++ try { ++ if (!process.waitFor(timeout, TimeUnit.SECONDS)) { ++ victim.interrupt(); ++ } ++ } ++ catch (InterruptedException e) { ++ log.println("Interrupted exception: " + e); ++ victim.interrupt(); ++ } + } + }; + timeoutHandlerThread.setName("Timeout Handler for " + cmd.get(0)); diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904105-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904105-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904105-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904105-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,42 @@ +Description: intermittent test failure in CleanupDirTests.agentvm.conc + jtharness does not synchronize calls to Observer. Synchronized keyword + needs to be added when processing shared state. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/297 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904105 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/src/share/classes/com/sun/javatest/regtest/report/TestStats.java ++++ b/src/share/classes/com/sun/javatest/regtest/report/TestStats.java +@@ -99,7 +99,7 @@ + } + + @Override +- public void finishedTest(TestResult tr) { ++ public synchronized void finishedTest(TestResult tr) { + add(tr); + } + +--- a/src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java ++++ b/src/share/classes/com/sun/javatest/regtest/report/XMLWriter.java +@@ -365,7 +365,7 @@ + } + + @Override +- public void finishedTest(TestResult tr) { ++ public synchronized void finishedTest(TestResult tr) { + try { + super.finishedTest(tr); + new XMLWriter(tr, mustVerify, harnessOut, harnessErr).toXML(); +--- a/src/share/classes/com/sun/javatest/regtest/tool/Tool.java ++++ b/src/share/classes/com/sun/javatest/regtest/tool/Tool.java +@@ -1946,7 +1946,7 @@ + + h.addObserver(new BasicObserver() { + @Override +- public void error(String msg) { ++ public synchronized void error(String msg) { + Tool.this.error(msg); + } + }); diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904106-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904106-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904106-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904106-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,75 @@ +Description: TestNativePath: use different work directories + Both agentvm and othervm targets in TestNativePath use the same work path + $(BUILDTESTDIR)/nativepath.othervm/work. + This causes intermittent test failures when the tests are run in parallel. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/298 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904106 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/test/nativepath/TestNativePath.gmk ++++ b/test/nativepath/TestNativePath.gmk +@@ -38,16 +38,16 @@ + -jdk:$(JDKHOME) \ + -nativepath:$(NATIVEPATH) \ + -vmoption:-Dcorrect.nativepath=$(NATIVEPATH) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm/report \ ++ -w:$(@:%.ok=%nativepath.othervm)/work \ ++ -r:$(@:%.ok=%nativepath.othervm)/report \ + -verbose:fail \ + $(@:$(BUILDTESTDIR)/TestNativePath.%.ok=-%) \ + $(TESTDIR)/nativepath/NativesOK.java + + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -verbose:fail \ + $(@:$(BUILDTESTDIR)/TestNativePath.%.ok=-%) \ + $(TESTDIR)/nativepath/NativesEmpty.java +@@ -82,8 +82,8 @@ + # should yield an error + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOK.java \ + 2>&1 | grep -q "Use -nativepath to specify the location of native code" +@@ -91,8 +91,8 @@ + # Exclude all tests with native code + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.othervm2/work \ +- -r:$(BUILDTESTDIR)/nativepath.othervm2/report \ ++ -w:$(@:%.ok=%nativepath.othervm2)/work \ ++ -r:$(@:%.ok=%nativepath.othervm2)/report \ + -k:!native \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOK.java \ +@@ -103,15 +103,15 @@ + -jdk:$(JDKHOME) \ + -nativepath:$(NATIVEPATH) \ + -e:CORRECTNATIVEPATH=$(NATIVEPATH) \ +- -w:$(BUILDTESTDIR)/nativepath.shell/work \ +- -r:$(BUILDTESTDIR)/nativepath.shell/report \ ++ -w:$(@:%.ok=%nativepath.shell)/work \ ++ -r:$(@:%.ok=%nativepath.shell)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesOKShell.sh + + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -jdk:$(JDKHOME) \ +- -w:$(BUILDTESTDIR)/nativepath.shell/work \ +- -r:$(BUILDTESTDIR)/nativepath.shell/report \ ++ -w:$(@:%.ok=%nativepath.shell)/work \ ++ -r:$(@:%.ok=%nativepath.shell)/report \ + -verbose:fail \ + $(TESTDIR)/nativepath/NativesEmptyShell.sh + diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904107-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904107-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904107-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904107-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,38 @@ +Description: AgentOut.othervm.ok should not access $(BUILDTESTDIR)/AgentOut.agentvm + AgentOut.othervm.ok tries to access $(BUILDTESTDIR)/AgentOut.agentvm. + This should only happen in AgentOut.agentvm.ok. + Add a new target to filter log lines that depends on AgentOut.agentvm.ok. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/pull/299 +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904107 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115694 +Last-Update: 2025-10-28 + +--- a/test/agentout/AgentOut.gmk ++++ b/test/agentout/AgentOut.gmk +@@ -78,6 +78,10 @@ + < $$i \ + > `dirname $$i`-filtered/`basename $$i` ; \ + done ++ # ++ echo "run at `date`" > $@ ++ ++$(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered.ok: $(BUILDTESTDIR)/AgentOut.agentvm.ok + # merge direct and stderr from agent CompileTest to match stderr from othervm CompileTest + $(CAT) $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-direct.log \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-System.err.log \ +@@ -85,12 +89,10 @@ + $(MV) $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/tmp.log \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-System.err.log + $(CAT) < $(DEV_NULL) > $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered/CompileTest-direct.log +- # +- echo "run at `date`" > $@ + + $(BUILDTESTDIR)/AgentOut.ok: \ +- $(BUILDTESTDIR)/AgentOut.agentvm.ok \ +- $(BUILDTESTDIR)/AgentOut.othervm.ok ++ $(BUILDTESTDIR)/AgentOut.othervm.ok \ ++ $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered.ok + $(DIFF) --strip-trailing-cr --recursive \ + $(BUILDTESTDIR)/AgentOut.agentvm/logs-filtered \ + $(BUILDTESTDIR)/AgentOut.othervm/logs-filtered diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904152.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904152.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904152.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904152.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,73 @@ +Description: 7904152: jtreg tests fail with openjdk 25 + The policy tests try to set the Security manager on the command-line + causing the Security Manager error. + The last supported JDK that allows setting the security manager is 21. +Author: Vladimir Petko +Origin: upstream, https://github.com/openjdk/jtreg/commit/da8892fb26a51fc5d4c3d4e3be74384aa29f64ce +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904152 +Last-Update: 2026-02-16 + +--- a/doc/building.md ++++ b/doc/building.md +@@ -118,7 +118,13 @@ + ``` + + Some tests depend on specific versions of JDK being available, specified +-by the following variables: `JDK8HOME`, `JDK9HOME`, `JDK14HOME`, `JDK18HOME`. ++by the following variables: ++- `JDK8HOME` ++- `JDK9HOME` ++- `JDK14HOME` ++- `JDK18HOME` ++- `JDK21HOME` ++- `JDK25HOME` + A test that requires any of these version of JDK will be skipped if the + variable is not set. + +--- a/make/Makefile ++++ b/make/Makefile +@@ -60,6 +60,12 @@ + ifndef JDK18HOME + @echo "Warning: JDK18HOME not set; some tests may not have been executed" + endif ++ifndef JDK21HOME ++ @echo "Warning: JDK21HOME not set; some tests may not have been executed" ++endif ++ifndef JDK25HOME ++ @echo "Warning: JDK25HOME not set; some tests may not have been executed" ++endif + ifdef HEADLESS + @echo "Warning: HEADLESS is set; some tests may not have been executed" + endif +@@ -110,6 +116,12 @@ + ifdef JDK18HOME + @echo "JDK18HOME = $(JDK18HOME)" + endif ++ifdef JDK21HOME ++ @echo "JDK21HOME = $(JDK21HOME)" ++endif ++ifdef JDK25HOME ++ @echo "JDK25HOME = $(JDK25HOME)" ++endif + @echo "JDKHOME = $(JDKHOME)" + @echo "JAVATEST_HOME = $(JAVATEST_HOME)" + ifneq ($(JTHARNESS_HOME), $(JAVATEST_HOME)) +--- a/test/policy/PolicyTest.gmk ++++ b/test/policy/PolicyTest.gmk +@@ -31,7 +31,7 @@ + $(RM) $(@:%.ok=%) ; $(MKDIR) $(@:%.ok=%) + $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \ + -w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \ +- -jdk:$(JDKHOME) \ ++ -jdk:$(JDK21HOME) \ + -agentvm \ + -retain:all \ + $(TESTDIR)/policy/ \ +@@ -44,5 +44,6 @@ + $(GREP) 'grant.*testng[^ ]*.jar' $(@:%.ok=%)/work/TestNG/simple.policy_new + echo "test passed at `date`" > $@ + ++ifdef JDK21HOME + TESTS.jtreg += $(BUILDTESTDIR)/PolicyTest.ok +- ++endif diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904157-proposed.patch jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904157-proposed.patch --- jtreg7-7.5.1+1+ds1/debian/patches/codetools-7904157-proposed.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/codetools-7904157-proposed.patch 2026-02-23 04:42:48.000000000 +0000 @@ -0,0 +1,18 @@ +Description: Set compile timeout for TimeoutDefaultSecondsWaiter on zero vm + The TimeoutDefaultSecondsWaiter test fails on zero vm because the + compilation times out. Add override for the compilation timeout. +Author: Vladimir Petko +Bug: https://bugs.openjdk.org/browse/CODETOOLS-7904157 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1128796 +Last-Update: 2026-02-23 + +--- a/test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java ++++ b/test/timeoutDefaultSeconds/TimeoutDefaultSecondsWaiter.java +@@ -30,6 +30,7 @@ + /* + * @test id=one + * @summary Test should be interrupted after 1 second, configured in main action ++ * @compile/timeout=1 TimeoutDefaultSecondsWaiter.java + * @run main/timeout=1 TimeoutDefaultSecondsWaiter + */ + public class TimeoutDefaultSecondsWaiter { diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/flush-alarm.patch jtreg7-7.5.2+1+ds2/debian/patches/flush-alarm.patch --- jtreg7-7.5.1+1+ds1/debian/patches/flush-alarm.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/flush-alarm.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Flush alarm output + Addresses sporadic FTBFS during builds on some systems related + to 'missing "Timeout signalled" action timeout message' errors. +Author: Vladimir Petko +Forwarded: not-needed +--- a/src/share/classes/com/sun/javatest/regtest/agent/Alarm.java ++++ b/src/share/classes/com/sun/javatest/regtest/agent/Alarm.java +@@ -147,6 +147,7 @@ + } else if (count % 100 == 0) { + msgOut.println(String.format("Timeout refired %d times", count)); + } ++ msgOut.flush(); + } + count++; + fired = true; diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/preview-test.patch jtreg7-7.5.2+1+ds2/debian/patches/preview-test.patch --- jtreg7-7.5.1+1+ds1/debian/patches/preview-test.patch 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/preview-test.patch 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,31 @@ +Description: Enable preview feature tests for Java > 11 + openjdk-11 does not have preview features. Enable preview tests + for Java specification version > 11. + The patch is not needed upstream, as upstream is on 8.x. + jtreg 8.x requires minimum Java version 17. +Author: Vladimir Petko +Forwarded: not-needed +Last-Update: 2025-08-04 +--- a/test/previewLeaking/TestPreviewLeaking.gmk ++++ b/test/previewLeaking/TestPreviewLeaking.gmk +@@ -39,4 +39,8 @@ + $(TESTDIR)/previewLeaking/ + echo "test passed at `date`" > $@ + ++INCLUDE_PREVIEW_TEST := $(shell if [ ${JAVA_SPECIFICATION_VERSION} -gt 11 ]; then echo 1; else echo 0; fi) ++ ++ifeq ($(INCLUDE_PREVIEW_TEST),1) + TESTS.jtreg += $(BUILDTESTDIR)/PreviewLeakingTest.ok ++endif +--- a/test/preview/PreviewTest.gmk ++++ b/test/preview/PreviewTest.gmk +@@ -54,5 +54,9 @@ + $(GREP) -s 'Test results: failed: 3; error: 1' $(@:%.ok=%/jt.log) > /dev/null + echo "test passed at `date`" > $@ + ++INCLUDE_PREVIEW_TEST := $(shell if [ ${JAVA_SPECIFICATION_VERSION} -gt 11 ]; then echo 1; else echo 0; fi) ++ ++ifeq ($(INCLUDE_PREVIEW_TEST),1) + TESTS.jtreg += $(BUILDTESTDIR)/PreviewTest_good.ok + TESTS.jtreg += $(BUILDTESTDIR)/PreviewTest_bad.ok ++endif diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/reproducible-build.patch jtreg7-7.5.2+1+ds2/debian/patches/reproducible-build.patch --- jtreg7-7.5.1+1+ds1/debian/patches/reproducible-build.patch 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/reproducible-build.patch 2026-01-11 23:06:11.000000000 +0000 @@ -18,4 +18,4 @@ + $(IMAGES_DIR)/%.jar: pkgsToFiles.sh $(RM) $@ $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%) - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/series jtreg7-7.5.2+1+ds2/debian/patches/series --- jtreg7-7.5.1+1+ds1/debian/patches/series 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/series 2026-02-23 04:42:48.000000000 +0000 @@ -26,3 +26,11 @@ testng-build-with-gradle.patch jtdiff-version.patch java21-codetools-7903646.patch +preview-test.patch +codetools-7904101-proposed.patch +codetools-7904104-proposed.patch +codetools-7904105-proposed.patch +codetools-7904106-proposed.patch +codetools-7904107-proposed.patch +codetools-7904152.patch +codetools-7904157-proposed.patch diff -Nru jtreg7-7.5.1+1+ds1/debian/patches/testng-build-with-gradle.patch jtreg7-7.5.2+1+ds2/debian/patches/testng-build-with-gradle.patch --- jtreg7-7.5.1+1+ds1/debian/patches/testng-build-with-gradle.patch 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/patches/testng-build-with-gradle.patch 2026-02-23 04:42:48.000000000 +0000 @@ -4,7 +4,7 @@ --- /dev/null +++ b/testng/build.gradle -@@ -0,0 +1,118 @@ +@@ -0,0 +1,117 @@ +plugins { + id 'java-library' + id 'maven-publish' @@ -27,7 +27,6 @@ + compile 'org.apache.ant:ant:1.10.12' + compile 'com.google.inject:guice:5.1.0' + compile 'junit:junit:4.13.2' -+ compile 'org.yaml:snakeyaml:1.33' + compile 'org.assertj:assertj-core:2.3.0' + compile 'com.google.code.findbugs:jsr305:debian' +} diff -Nru jtreg7-7.5.1+1+ds1/debian/picocli/maven.rules jtreg7-7.5.2+1+ds2/debian/picocli/maven.rules --- jtreg7-7.5.1+1+ds1/debian/picocli/maven.rules 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/picocli/maven.rules 2026-01-11 23:06:11.000000000 +0000 @@ -1,3 +1,3 @@ jline jline jar * * * - +org.codehaus.groovy groovy-all * s/2.*/debian/ * * diff -Nru jtreg7-7.5.1+1+ds1/debian/source/lintian-overrides jtreg7-7.5.2+1+ds2/debian/source/lintian-overrides --- jtreg7-7.5.1+1+ds1/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/source/lintian-overrides 2026-01-11 23:06:11.000000000 +0000 @@ -0,0 +1,16 @@ +# Package does not install component examples +jtreg7 source: package-does-not-install-examples + +# junit5 tests contain prebuilt java jars +jtreg7 source: source-contains-prebuilt-java-object + +# jtreg7 is used in backport, so it uses compat-file +jtreg7 source: uses-debhelper-compat-file +jtreg7 source: package-uses-old-debhelper-compat-version + +# libhamscrest-java packaging license d/copyright contains +# symlink. The license information copied verbatim. +jtreg7: copyright-refers-to-symlink-license + +# jtreg uses old style GPL license +jtreg7 source: old-fsf-address-in-copyright-file diff -Nru jtreg7-7.5.1+1+ds1/debian/watch jtreg7-7.5.2+1+ds2/debian/watch --- jtreg7-7.5.1+1+ds1/debian/watch 2025-04-07 20:14:26.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/debian/watch 2026-02-23 04:42:48.000000000 +0000 @@ -1,6 +1,6 @@ version=4 -opts="compression=gzip,repack,repacksuffix=+ds1,dversionmangle=s/\+(debian|dfsg|ds|deb)(\.?\d+)?$//" \ -https://github.com/openjdk/jtreg/tags .*/jtreg-([\d\.]+(?:\+[0-9]+)?)\.tar\.gz +opts="compression=gzip,repack,repacksuffix=+ds2,dversionmangle=s/\+(debian|dfsg|ds|deb)(\.?\d+)?$//" \ +https://github.com/openjdk/jtreg/tags .*/jtreg-(7.[\d\.]+(?:\+[0-9]+)?)\.tar\.gz opts="compression=gzip,component=jansi1,repack" \ https://github.com/fusesource/jansi/tags?after=jansi-2.1.0 .*/jansi-project-(1.18)\.tar\.gz 1.18 @@ -12,7 +12,7 @@ https://github.com/junit-team/junit4/tags .*/r?(4.13.2)\.tar\.gz 4.13.2 opts="compression=gzip,component=junit5,repack" \ -https://github.com/junit-team/junit5/tags .*/r(5.11.4)\.tar\.gz 5.11.4 +https://github.com/junit-team/junit5/tags?after=r5.12.2 .*/r(5.11.4)\.tar\.gz 5.11.4 opts="compression=gzip,component=libhamcrest-java,repack" \ https://github.com/hamcrest/JavaHamcrest/tags .*/(?:hamcrest-java-|v)(2.2)\.tar\.gz 2.2 diff -Nru jtreg7-7.5.1+1+ds1/make/Defs.gmk jtreg7-7.5.2+1+ds2/make/Defs.gmk --- jtreg7-7.5.1+1+ds1/make/Defs.gmk 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/Defs.gmk 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -152,7 +152,7 @@ endif LN = /bin/ln LS = /bin/ls -MKDIR = /bin/mkdir +MKDIR = /bin/mkdir -p MV = /bin/mv PANDOC := $(shell if [ -r /usr/bin/pandoc ]; then \ echo /usr/bin/pandoc ; \ diff -Nru jtreg7-7.5.1+1+ds1/make/Makefile jtreg7-7.5.2+1+ds2/make/Makefile --- jtreg7-7.5.1+1+ds1/make/Makefile 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/Makefile 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -129,7 +129,7 @@ #---------------------------------------------------------------------- $(BUILDTESTDIR): - $(MKDIR) -p $@ + $(MKDIR) $@ #---------------------------------------------------------------------- diff -Nru jtreg7-7.5.1+1+ds1/make/Rules.gmk jtreg7-7.5.2+1+ds2/make/Rules.gmk --- jtreg7-7.5.1+1+ds1/make/Rules.gmk 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/Rules.gmk 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,29 +28,29 @@ # Copy resources (*.properties) into classes directory from source tree $(CLASSDIR)/%.properties: $(JAVADIR)/%.properties - $(RM) -f $@ - $(MKDIR) -p $(@D) + $(RM) $@ + $(MKDIR) $(@D) $(CP) $(@:$(CLASSDIR)/%=$(JAVADIR)/%) $@ $(CLASSDIR)/%.gif: $(JAVADIR)/%.gif - $(RM) -f $@ - $(MKDIR) -p $(@D) + $(RM) $@ + $(MKDIR) $(@D) $(CP) $(@:$(CLASSDIR)/%=$(JAVADIR)/%) $@ $(CLASSDIR)/%.png: $(JAVADIR)/%.png - $(RM) -f $@ - $(MKDIR) -p $(@D) + $(RM) $@ + $(MKDIR) $(@D) $(CP) $(@:$(CLASSDIR)/%=$(JAVADIR)/%) $@ $(CLASSDIR)/META-INF/services/%: $(JAVADIR)/META-INF/services/% - $(RM) -f $@ - $(MKDIR) -p $(@D) + $(RM) $@ + $(MKDIR) $(@D) $(CP) $(@:$(CLASSDIR)/%=$(JAVADIR)/%) $@ #--------------------------------------------------------------------- $(CLASSDIR) $(BUILDDIR) $(BUILDDIR)/testClasses $(BUILDDIR)/testWork $(BUILDDIR)/testReport: - $(MKDIR) -p $@ + $(MKDIR) $@ #---------------------------------------------------------------------- # @@ -69,8 +69,8 @@ $(IMAGES_DIR)/%.jar: pkgsToFiles.sh $(RM) $@ $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%) - $(MKDIR) -p $(@D) - $(MKDIR) -p $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%) + $(MKDIR) $(@D) + $(MKDIR) $(@:$(IMAGES_DIR)/%.jar=$(BUILDDIR)/jarData/%) ( if [ -n "$(JAR_MAINCLASS)" ]; then echo "Main-class: $(JAR_MAINCLASS)" ; fi ; \ if [ -n "$(JAR_CLASSPATH)" ]; then echo "Class-Path: $(JAR_CLASSPATH)" ; fi ; \ echo "$(@F:%.jar=%)-Name: $(@F:%.jar=%)" ; \ diff -Nru jtreg7-7.5.1+1+ds1/make/build-support/version-numbers jtreg7-7.5.2+1+ds2/make/build-support/version-numbers --- jtreg7-7.5.1+1+ds1/make/build-support/version-numbers 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/build-support/version-numbers 2025-10-28 19:26:35.000000000 +0000 @@ -23,7 +23,7 @@ # questions. # -JTREG_VERSION=7.5.1 +JTREG_VERSION=7.5.2 DEFAULT_ANT_VERSION=1.10.8 DEFAULT_ANT_ARCHIVE_CHECKSUM=dbe187ce2963f9df8a67de8aaff3b0a437d06978 diff -Nru jtreg7-7.5.1+1+ds1/make/jtdiff.gmk jtreg7-7.5.2+1+ds2/make/jtdiff.gmk --- jtreg7-7.5.1+1+ds1/make/jtdiff.gmk 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/jtdiff.gmk 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ # executable scripts $(JTREG_IMAGEDIR)/bin/jtdiff: $(SRCSHAREBINDIR)/jtdiff.sh - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(RM) $@ $(CP) $< $@ $(CHMOD) a+x,a-w $@ diff -Nru jtreg7-7.5.1+1+ds1/make/jtreg.gmk jtreg7-7.5.2+1+ds2/make/jtreg.gmk --- jtreg7-7.5.1+1+ds1/make/jtreg.gmk 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/make/jtreg.gmk 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ $(BUILDDIR)/classes.com.sun.javatest.regtest.agent.ok: \ $(JAVAFILES.com.sun.javatest.regtest-agentvm) - $(MKDIR) -p $(CLASSDIR) + $(MKDIR) $(CLASSDIR) CLASSPATH="$(CLASSDIR)$(PS)$(JAVATEST_JAR)$(PS)$(JUNIT_CLASSPATH)$(PS)$(TESTNG_CLASSPATH)" \ $(REGTEST_AGENT_JAVAC) $(REGTEST_AGENT_JAVAC_OPTIONS) \ -d $(CLASSDIR) \ @@ -103,7 +103,7 @@ $(ASMTOOLS_JAR) \ $(TESTNG_JARS) \ $(JUNIT_JARS) - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) ( \ echo "asmtools=$(notdir $(ASMTOOLS_JAR))" ; \ echo "testng=$(notdir $(TESTNG_JARS))" ; \ @@ -132,7 +132,7 @@ $(JTREG_USAGE) $(JTREG_COPYRIGHT): $(TOPDIR)/COPYRIGHT - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(RM) $@ $(CP) $< $@ @@ -144,7 +144,7 @@ $(JTREG_FAQ) $(BUILDDIR)/alt-faq.html: $(SRCJTREGDOCDIR)/faq.md \ $(SRCJTREGDOCDIR)/faq-local-style.html \ $(SRCJTREGDOCDIR)/faq-intro.html - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(ECHO) '/
/{;:a;N;/<\/header>/!ba;};/

/d' | tr ';' '\n' > $(BUILDDIR)/fixupheader $(PANDOC) \ --standalone \ @@ -165,20 +165,20 @@ $(JTREG_README): $(SRCJTREGDOCDIR)/README - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(RM) $@ $(CP) $< $@ $(JTREG_TAGSPEC): $(JTREG_IMAGEDIR)/doc/jtreg/%: $(SRCJTREGDOCDIR)/% $(RM) $@ - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(CP) $^ $@ $(JTREG_USAGE): $(BUILDDIR)/jtreg-usage.txt $(CP) $^ $@ $(JTREG_LICENSE): $(TOPDIR)/LICENSE - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(CP) $^ $@ $(BUILDDIR)/jtreg-usage.txt: \ @@ -261,8 +261,8 @@ # define IMPORT_FILE $(2)/$(notdir $(1)): $(call PosixPath,$(1)) - $(RM) -f $$@ - $(MKDIR) -p $$(@D) + $(RM) $$@ + $(MKDIR) $$(@D) $(CP) $$< $$@ TARGETS.ZIP.jtreg += $(2)/$(notdir $(1)) @@ -275,8 +275,8 @@ TARGETS.com.sun.javatest.regtest += $(RESOURCES.com.sun.javatest.regtest) $(JTREG_IMAGEDIR)/lib/javatest.jar: $(call PosixPath,$(JAVATEST_JAR)) - $(RM) -f $@ - $(MKDIR) -p $(@D) + $(RM) $@ + $(MKDIR) $(@D) $(CP) $< $@ TARGETS.ZIP.jtreg += $(JTREG_IMAGEJARDIR)/javatest.jar @@ -326,7 +326,7 @@ # executable scripts $(JTREG_IMAGEDIR)/bin/jtreg: $(SRCSHAREBINDIR)/jtreg.sh - $(MKDIR) -p $(@D) + $(MKDIR) $(@D) $(RM) $@ $(CP) $< $@ $(CHMOD) a+x,a-w $@ diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/diff/Help.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/Help.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/diff/Help.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/Help.java 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -143,7 +143,6 @@ */ out.println(i18n.getString("help.version.txt", versionArgs)); - out.println(i18n.getString("help.copyright.txt")); } private File getDocDir() { @@ -285,8 +284,6 @@ ww.write("\n\n"); ww.write(i18n.getString("help.cmd.ant")); ww.write("\n\n"); - ww.write(i18n.getString("help.copyright.txt")); - ww.write("\n\n"); ww.flush(); } catch (IOException e) { diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/diff/i18n.properties jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/i18n.properties --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/diff/i18n.properties 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/diff/i18n.properties 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,6 @@ help.cmd.proto=Usage:\n\t{0} options... [directory|file]... help.cmd.summaryHead=Information is available for the following topics: help.cmd.tail= -help.copyright.txt=Copyright (c) 2008, 2013 Oracle and/or its affiliates. \ - All rights reserved.\nUse is subject to license terms. help.compare.name=Compare Options help.compare.desc= diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java 2025-10-28 19:26:35.000000000 +0000 @@ -25,6 +25,11 @@ package com.sun.javatest.regtest.agent; +import org.junit.jupiter.api.extension.AnnotatedElementContext; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.io.CleanupMode; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.api.io.TempDirFactory; import org.junit.platform.engine.DiscoverySelector; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestSource; @@ -46,6 +51,9 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.time.Duration; import java.util.Map; import java.util.Optional; @@ -147,6 +155,8 @@ } LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(selector) + .configurationParameter(TempDir.DEFAULT_CLEANUP_MODE_PROPERTY_NAME, CleanupMode.NEVER.name()) + .configurationParameter(TempDir.DEFAULT_FACTORY_PROPERTY_NAME, ScratchAsTemporaryDirectory.class.getName()) .build(); SummaryGeneratingListener summaryGeneratingListener = new SummaryGeneratingListener(); @@ -309,4 +319,20 @@ return testSource.toString(); } } + + /** + * Custom temporary directory factory for JUnit Jupiter tests. + *

+ * When jtreg executes a test, the current directory for the test is set + * to a scratch directory so that the test can easily write any temporary + * files. This implementation ensures JUnit's standard factory follows + * that rule. + */ + static class ScratchAsTemporaryDirectory implements TempDirFactory { + @Override + public Path createTempDirectory(AnnotatedElementContext context, ExtensionContext extensionContext) throws Exception { + Path scratchDirectory = Paths.get("").toAbsolutePath(); + return Files.createTempDirectory(scratchDirectory, "junit-"); + } + } } diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/RegressionTestSuite.java 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,6 +88,9 @@ return map; } + public TestProperties getTestProperties() { + return properties; + } @Override public String getName() { @@ -121,7 +124,7 @@ public Script createScript(TestDescription td, String[] exclTestCases, TestEnvironment scriptEnv, WorkDirectory workDir, BackupPolicy backupPolicy) throws Fault { - Script s = new RegressionScript(); + Script s = new RegressionScript(properties); // generic script init s.initTestDescription(td); diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/config/TestProperties.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/TestProperties.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/config/TestProperties.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/config/TestProperties.java 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.lang.ref.SoftReference; +import java.time.Duration; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashSet; @@ -162,6 +163,10 @@ return getEntry(file).maxOutputSize; } + public final Duration getDefaultTimeout(File file) { + return getEntry(file).defaultTimeout; + } + boolean getAllowSmartActionArgs(File file) { return getEntry(file).allowSmartActionArgs; } @@ -220,6 +225,7 @@ final int maxOutputSize; final boolean allowSmartActionArgs; final boolean enablePreview; + final Duration defaultTimeout; Entry(Entry parent, File dir) { this.parent = parent; @@ -270,6 +276,9 @@ // add the maxOutputSize for result content maxOutputSize = getInt("maxOutputSize", -1); + // add the default test timeout value in seconds + defaultTimeout = Duration.ofSeconds(getInt("timeout.default.seconds", 120)); + // determine whether tests can use "smart action args" allowSmartActionArgs = initAllowSmartActionArgs(parent); @@ -291,6 +300,7 @@ extLibRoots = parent.extLibRoots; modules = parent.modules; maxOutputSize = parent.maxOutputSize; + defaultTimeout = parent.defaultTimeout; allowSmartActionArgs = parent.allowSmartActionArgs; enablePreview = parent.enablePreview; } diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java 2025-10-28 19:26:35.000000000 +0000 @@ -208,31 +208,24 @@ // note: in the following code, some args are overwritten in place String currArg = args.get(i); + boolean isSourceFile = false; + if (currArg.endsWith(".java")) { foundJavaFile = true; - File sourceFile = new File(currArg.replace('/', File.separatorChar)); - if (!sourceFile.isAbsolute()) { - // User must have used @compile, so file must be - // in the same directory as the defining file. - if (multiModule) - addModule(currArg); - Path absSourceFile = locations.absTestSrcFile(module, sourceFile); - if (!Files.exists(absSourceFile)) - throw new ParseException(CANT_FIND_SRC + currArg); - args.set(i, absSourceFile.toString()); - } - } else if (currArg.endsWith(".jasm") || currArg.endsWith("jcod")) { - if (module != null) { - throw new ParseException(COMPILE_OPT_DISALLOW); - } + isSourceFile = true; + } else if (currArg.endsWith(".jasm") || currArg.endsWith(".jcod")) { foundAsmFile = true; + isSourceFile = true; + } + + if (isSourceFile) { File sourceFile = new File(currArg.replace('/', File.separatorChar)); if (!sourceFile.isAbsolute()) { // User must have used @compile, so file must be // in the same directory as the defining file. if (multiModule) addModule(currArg); - Path absSourceFile = locations.absTestSrcFile(null, sourceFile); + Path absSourceFile = locations.absTestSrcFile(module, sourceFile); if (!Files.exists(absSourceFile)) throw new ParseException(CANT_FIND_SRC + currArg); args.set(i, absSourceFile.toString()); @@ -363,11 +356,7 @@ } } - if (runJavac - && !script.disablePreview() - && !seenEnablePreview - && (script.enablePreview()) - && (libLocn == null || libLocn.isTest())) { + if (runJavac && script.enablePreview() && !seenEnablePreview) { String version = script.getTestJDKVersion().name(); // always prepend in order to not mess with variadic arguments if (!seenSourceOrRelease) { diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,11 @@ package com.sun.javatest.regtest.exec; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; import java.io.UncheckedIOException; import java.lang.reflect.Method; -import java.net.InetAddress; import java.net.MalformedURLException; -import java.net.UnknownHostException; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; @@ -44,6 +43,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.TreeSet; import java.util.function.Consumer; @@ -74,6 +74,7 @@ import com.sun.javatest.regtest.config.RegressionEnvironment; import com.sun.javatest.regtest.config.RegressionParameters; import com.sun.javatest.regtest.config.RegressionTestSuite; +import com.sun.javatest.regtest.config.TestProperties; import com.sun.javatest.regtest.report.SummaryReporter; import com.sun.javatest.regtest.report.Verbose; import com.sun.javatest.regtest.tool.Version; @@ -347,7 +348,7 @@ public static Set getSourceFiles(RegressionParameters p, TestDescription td) { Consumer logger = System.err::println; try { - RegressionScript tmp = new RegressionScript(); + RegressionScript tmp = new RegressionScript(p.getTestSuite().getTestProperties()); // init the script enough to parse the actions tmp.params = p; tmp.td= td; @@ -468,11 +469,9 @@ return newArgs; } - private static final Pattern namePattern = Pattern.compile("\\$\\{([A-Za-z0-9._]+)}"); - private static String evalNames(String arg, Expr.Context c, Map testProps) throws Expr.Fault, ParseException { - Matcher m = namePattern.matcher(arg); + Matcher m = SMART_ACTION_NAME_PATTERN.matcher(arg); StringBuilder sb = null; // Note that '\' may appear in the replacement value for paths on Windows, // and so, in the following loop, avoid using Matcher::appendReplacement, @@ -528,10 +527,15 @@ * @return the timeout, in seconds */ protected int getActionTimeout(int time) { - final int DEFAULT_ACTION_TIMEOUT = 120; // seconds - return isTimeoutsEnabled() - ? (int) ((time < 0 ? DEFAULT_ACTION_TIMEOUT : time) * getTimeoutFactor()) - : 0; + if (!isTimeoutsEnabled() || time == 0) { + return 0; + } + int seconds = time > 0 ? time : getDefaultTimeoutSeconds(); + return (int) (seconds * getTimeoutFactor()); + } + + private int getDefaultTimeoutSeconds() { + return (int) properties.getDefaultTimeout(getTestDescription().getFile()).toSeconds(); } protected float getTimeoutFactor() { @@ -1136,6 +1140,7 @@ p.put("test.verbose", verbose.toString()); } p.put("test.file", locations.absTestFile().toString()); + computeMainClassNameFromTestFile().ifPresent(name -> p.put("test.main.class", name)); p.put("test.src", locations.absTestSrcDir().toString()); p.put("test.src.path", toString(locations.absTestSrcPath())); p.put("test.classes", locations.absTestClsDir().toString()); @@ -1171,18 +1176,33 @@ p.put("test.root", getTestRootDir().getPath()); return Collections.unmodifiableMap(p); } - // where + private String toString(List files) { return files.stream() .map(Path::toString) .collect(Collectors.joining(File.pathSeparator)); } -// // where -// private String toString(List files) { -// return files.stream() -// .map(File::getPath) -// .collect(Collectors.joining(File.pathSeparator)); -// } + + private Optional computeMainClassNameFromTestFile() { + Path file = locations.absTestFile(); + // Take file name as basis for class name. + String fileName = file.getFileName().toString(); + int fileNameLength = fileName.length(); // including ".java".length() = 5 + if (fileNameLength <= 5 || !fileName.endsWith(".java")) { + return Optional.empty(); + } + String className = fileName.substring(0, fileNameLength - 5); + // Scan .java file for "package NAME;" without taking comments into account. + try { + // Assume non-large files in UTF-8 encoding. + String charContent = Files.readString(file); + Matcher packageMatcher = PACKAGE_NAME_PATTERN.matcher(charContent); + String packageName = packageMatcher.find() ? packageMatcher.group(1) + "." : ""; + return Optional.of(packageName + className); + } catch (IOException ignored) { + return Optional.empty(); + } + } File getTestRootDir() { return params.getTestSuite().getRootDir(); @@ -1322,6 +1342,10 @@ ILLEGAL_ACCESS_INIT = "Illegal access to init method: ", BAD_ACTION = "Bad action for script: "; + private static final Pattern + SMART_ACTION_NAME_PATTERN = Pattern.compile("\\$\\{([A-Za-z0-9._]+)}"), + PACKAGE_NAME_PATTERN = Pattern.compile("package\\s+([\\w.]+);"); + //----------member variables----------------------------------------------- private final Map> actionTable = new HashMap<>(); @@ -1342,5 +1366,10 @@ private Modules modules; private ScratchDirectory scratchDirectory; Locations locations; + private final TestProperties properties; + + public RegressionScript(TestProperties properties) { + this.properties = properties; + } } diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/tool/Help.java jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/Help.java --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/tool/Help.java 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/Help.java 2025-10-28 19:26:35.000000000 +0000 @@ -241,7 +241,6 @@ */ out.println(i18n.getString("help.version.txt", versionArgs)); - out.println(i18n.getString("help.copyright.txt")); for (VersionHelper h: versionHelpers) h.showVersion(out); } @@ -401,8 +400,6 @@ } } - ww.write('\n'); - ww.write(i18n.getString("help.copyright.txt")); ww.write("\n\n"); ww.flush(); diff -Nru jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/tool/i18n.properties jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/i18n.properties --- jtreg7-7.5.1+1+ds1/src/share/classes/com/sun/javatest/regtest/tool/i18n.properties 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/classes/com/sun/javatest/regtest/tool/i18n.properties 2025-10-28 19:26:35.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ available for the following topics.\n help.cmd.fullHead= help.cmd.summaryHead=Information is available for the following topics: -help.copyright.txt=Copyright (c) 1999, 2022, Oracle and/or its affiliates. \ +help.copyright.txt=Copyright (c) 1999, 2025, Oracle and/or its affiliates. \ All rights reserved.\nUse is subject to license terms. help.cmd.noEntriesFound=No entries were found that matched your query. diff -Nru jtreg7-7.5.1+1+ds1/src/share/doc/javatest/regtest/tag-spec.html jtreg7-7.5.2+1+ds2/src/share/doc/javatest/regtest/tag-spec.html --- jtreg7-7.5.1+1+ds1/src/share/doc/javatest/regtest/tag-spec.html 2025-02-11 21:35:23.000000000 +0000 +++ jtreg7-7.5.2+1+ds2/src/share/doc/javatest/regtest/tag-spec.html 2025-10-28 19:26:35.000000000 +0000 @@ -1,6 +1,6 @@