JDK-8298271 : java/security/SignedJar/spi-calendar-provider/TestSPISigned.java failing on Windows
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2022-12-07
  • Updated: 2022-12-24
  • Resolved: 2022-12-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 20 JDK 21
17.0.7-oracleFixed 20 b28Fixed 21Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8298274 :  
Description
The following test failed in the JDK20 CI:

java/security/SignedJar/spi-calendar-provider/TestSPISigned.java

The test was added with JDK-8298108.

Here's a snippet from the log file:

----------System.err:(25/1266)----------
 stdout: [Debug: Running test
];
 stderr: [Exception in thread "main" java.lang.RuntimeException: Test failed with signed jar and  argument java.locale.providers=SPI
	at TestSPISigned.doRunTest(TestSPISigned.java:115)
	at TestSPISigned.main(TestSPISigned.java:75)
Caused by: java.lang.RuntimeException: Expected calendar from SPI to be in effect: expected 4 to equal 1
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
	at TestSPISigned.check(TestSPISigned.java:121)
	at TestSPISigned.doRunTest(TestSPISigned.java:112)
	... 1 more
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:490)
	at TestSPISigned.main(TestSPISigned.java:103)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:1623)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1609 Date: 2022-12-23 17:10:24 +0000
23-12-2022

Fix Request (17u): Please approve this follow-up for JDK-8298108 in order to fix the test on Windows. The patch is not clean (only omits ProblemList.txt) as this is the fix for the original problem list. The test verifies the fix of JDK-8280890 which got integrated today (Dec 23, 2022). Test only patch, little risk. I intend to integrate only once JDK-8280890 and JDK-8298108 are both in the 17u-dev tree.
23-12-2022

Fix Request (11u): Please approve this follow-up for JDK-8298108 in order to fix the test on Windows. The patch is not clean as it omits the ProblemList.txt change. The test verifies the fix of JDK-8280890 which got integrated today (Dec 23, 2022). Test only patch, little risk. I intend to integrate only once JDK-8280890 and JDK-8298108 are both in the 11u-dev tree.
23-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/978 Date: 2022-12-22 17:18:26 +0000
22-12-2022

Changeset: cf93933e Author: Severin Gehwolf <sgehwolf@openjdk.org> Date: 2022-12-12 15:49:31 +0000 URL: https://git.openjdk.org/jdk20/commit/cf93933e21d146fe296b1e4b8e2ef06b699175d6
12-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20/pull/18 Date: 2022-12-12 10:37:18 +0000
12-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11606 Date: 2022-12-09 10:18:36 +0000
09-12-2022

Thanks, posted for review!
09-12-2022

[~sgehwolf] The following change should fix the issue. I just tested it and it passes on Windows platforms. Please submit a PR when you have a chance and also remove the test from the ProblemList. diff --git a/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java b/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java index e7cf5146252..1c882100fab 100644 --- a/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java +++ b/test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java @@ -26,6 +26,7 @@ import jdk.test.lib.SecurityTools; import jdk.test.lib.Asserts; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; +import java.io.File; import java.util.Calendar; import java.util.Locale; import java.util.List; @@ -95,7 +96,8 @@ public class TestSPISigned { testRun.add("-Djava.locale.providers=SPI"); testRun.add("-cp"); String classPath = System.getProperty("java.class.path"); - classPath = classPath + ":" + SIGNED_JAR.toAbsolutePath().toString(); + classPath = classPath + File.pathSeparator + + SIGNED_JAR.toAbsolutePath().toString(); testRun.add(classPath); testRun.add(TestSPISigned.class.getSimpleName()); testRun.add("run-test");
08-12-2022

OK, thanks! I need to find someone to test this for me. I'll post a PR with a fix as soon as we have something verified.
07-12-2022

[~sgehwolf] Yes, I think it is ok to lower the priority to P3 now that it is on the ProblemList. I took a look at the test. My best guess is that the classpath separator used in the test (":") is Unix specific, and you should be using the "path.separator" system property.
07-12-2022

[~mullan] With the problem list in place the priority (P2) of this can be lowered, now?
07-12-2022

[~mullan] https://github.com/openjdk/jdk/pull/11560 is the problem list PR.
07-12-2022

[~mullan] OK.
07-12-2022

[~sgehwolf] I would advise ProblemListing this test ASAP for the Windows platforms if a fix is not imminent as JDK 20 RDP is tomorrow.
07-12-2022