JDK-8159925 : sun/tools/jps/TestJpsJar.java still fails after fix for JDK-8153278
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2016-06-20
  • Updated: 2016-07-28
  • Resolved: 2016-07-08
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 9
9 b129Fixed
Related Reports
Relates :  
Description
The sun/tools/jps/TestJpsJar.java test can still fail after
JDK-8153278 has been fixed.

Here is a snippet of the failing .jtr file:

----------messages:(4/154)----------
command: main TestJpsJar
reason: User specified action: run main/othervm TestJpsJar 
Mode: othervm [/othervm specified]
elapsed time (seconds): 6.301
----------configuration:(3/69)----------
Boot Layer
  add exports: jdk.jartool/sun.tools.jar ALL-UNNAMED 

----------System.out:(91/3549)*----------
Running jar [-cfm, C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar, C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.mf, -C, C:\\local\\aurora\\sandbox\\results\\workDir\\classes\\2\\sun\\tools\\jps, ., -C, C:\\local\\aurora\\sandbox\\results\\workDir\\classes\\2\\lib\\testlibrary, .]
Command line: [C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\java.exe -XX:+UsePerfData -Xmx512m -Xlog:gc -Dmultiline.prop=value1
value2
value3 -XX:Flags=C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\vmflags -Dtest.jdk=C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME -Dtest.src=C:\\local\\aurora\\CommonData\\j2se_jdk\\jdk\\test\\sun\\tools\\jps -jar C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar monkey ]
[0.041s][info][gc] Using G1
[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData]
13696 Main
15744 JInfo
10500 MainWrapper
14468 JInfoTestLingeredApp
11092 MainWrapper
13332 MainWrapper
15252 MainWrapper
17748 Main
20692 Jps
3156 JpsBase
17176 Main
23772 -- process information unavailable
8540 MainWrapper
12128 -- process information unavailable
21216 SALauncher
20392 Main
24488 -- process information unavailable
4012 LingeredApp
12080 Main
21872 JInfo
10360 JInfoTestLingeredApp
13112 -- process information unavailable
16316 JpsBase.jar
17404 -- process information unavailable
3388 -- process information unavailable

[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData -q]
14468
14660
4012
19376
22160
3504
11092
11572
13332
15252
3156
10360
14236
14812
16316
8540

[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData -l]
11424 jdk.compiler/com.sun.tools.javac.Main
14660 jdk.compiler/com.sun.tools.javac.Main
22160 com.sun.javatest.regtest.agent.MainWrapper
3504 com.sun.javatest.regtest.agent.MainWrapper
11092 com.sun.javatest.regtest.agent.MainWrapper
11572 -- process information unavailable
13332 com.sun.javatest.regtest.agent.MainWrapper
15252 com.sun.javatest.regtest.agent.MainWrapper
21492 -- process information unavailable
3156 JpsBase
3352 jdk.test.lib.apps.LingeredApp
14236 jdk.compiler/com.sun.tools.javac.Main
16316 C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar
18364 jdk.jcmd/sun.tools.jps.Jps
8540 com.sun.javatest.regtest.agent.MainWrapper

 stdout: [11424 jdk.compiler/com.sun.tools.javac.Main
14660 jdk.compiler/com.sun.tools.javac.Main
22160 com.sun.javatest.regtest.agent.MainWrapper
3504 com.sun.javatest.regtest.agent.MainWrapper
11092 com.sun.javatest.regtest.agent.MainWrapper
11572 -- process information unavailable
13332 com.sun.javatest.regtest.agent.MainWrapper
15252 com.sun.javatest.regtest.agent.MainWrapper
21492 -- process information unavailable
3156 JpsBase
3352 jdk.test.lib.apps.LingeredApp
14236 jdk.compiler/com.sun.tools.javac.Main
16316 C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar
18364 jdk.jcmd/sun.tools.jps.Jps
8540 com.sun.javatest.regtest.agent.MainWrapper
];
 stderr: []
 exitValue = 0

Exception in thread "main" java.lang.RuntimeException: '^16316\\s+E:\\\\aurora\\\\sandbox\\\\results\\\\workDir\\\\sun\\\\tools\\\\jps\\\\TestJpsJar\\\\JpsBase\\.jar.*' missing from stdout/stderr 

	at jdk.testlibrary.OutputAnalyzer.shouldMatch(OutputAnalyzer.java:220)
	at JpsBase.main(JpsBase.java:89)

----------System.err:(106/3738)*----------
 stdout: [[0.041s][info][gc] Using G1
[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData]
13696 Main
15744 JInfo
10500 MainWrapper
14468 JInfoTestLingeredApp
11092 MainWrapper
13332 MainWrapper
15252 MainWrapper
17748 Main
20692 Jps
3156 JpsBase
17176 Main
23772 -- process information unavailable
8540 MainWrapper
12128 -- process information unavailable
21216 SALauncher
20392 Main
24488 -- process information unavailable
4012 LingeredApp
12080 Main
21872 JInfo
10360 JInfoTestLingeredApp
13112 -- process information unavailable
16316 JpsBase.jar
17404 -- process information unavailable
3388 -- process information unavailable

[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData -q]
14468
14660
4012
19376
22160
3504
11092
11572
13332
15252
3156
10360
14236
14812
16316
8540

[C:\\local\\aurora\\CommonData\\TEST_JAVA_HOME\\bin\\jps.exe -J-XX:+UsePerfData -l]
11424 jdk.compiler/com.sun.tools.javac.Main
14660 jdk.compiler/com.sun.tools.javac.Main
22160 com.sun.javatest.regtest.agent.MainWrapper
3504 com.sun.javatest.regtest.agent.MainWrapper
11092 com.sun.javatest.regtest.agent.MainWrapper
11572 -- process information unavailable
13332 com.sun.javatest.regtest.agent.MainWrapper
15252 com.sun.javatest.regtest.agent.MainWrapper
21492 -- process information unavailable
3156 JpsBase
3352 jdk.test.lib.apps.LingeredApp
14236 jdk.compiler/com.sun.tools.javac.Main
16316 C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar
18364 jdk.jcmd/sun.tools.jps.Jps
8540 com.sun.javatest.regtest.agent.MainWrapper

];
 stderr: [ stdout: [11424 jdk.compiler/com.sun.tools.javac.Main
14660 jdk.compiler/com.sun.tools.javac.Main
22160 com.sun.javatest.regtest.agent.MainWrapper
3504 com.sun.javatest.regtest.agent.MainWrapper
11092 com.sun.javatest.regtest.agent.MainWrapper
11572 -- process information unavailable
13332 com.sun.javatest.regtest.agent.MainWrapper
15252 com.sun.javatest.regtest.agent.MainWrapper
21492 -- process information unavailable
3156 JpsBase
3352 jdk.test.lib.apps.LingeredApp
14236 jdk.compiler/com.sun.tools.javac.Main
16316 C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar
18364 jdk.jcmd/sun.tools.jps.Jps
8540 com.sun.javatest.regtest.agent.MainWrapper
];
 stderr: []
 exitValue = 0

Exception in thread "main" java.lang.RuntimeException: '^16316\\s+E:\\\\aurora\\\\sandbox\\\\results\\\\workDir\\\\sun\\\\tools\\\\jps\\\\TestJpsJar\\\\JpsBase\\.jar.*' missing from stdout/stderr 

	at jdk.testlibrary.OutputAnalyzer.shouldMatch(OutputAnalyzer.java:220)
	at JpsBase.main(JpsBase.java:89)
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0]

	at jdk.testlibrary.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:371)
	at TestJpsJar.main(TestJpsJar.java:62)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.lang.Thread.run(java.base@9-internal/Thread.java:843)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]


Here is the failing exception:

Exception in thread "main" java.lang.RuntimeException: '^16316\\s+E:\\\\aurora\\\\sandbox\\\\results\\\\workDir\\\\sun\\\\tools\\\\jps\\\\TestJpsJar\\\\JpsBase\\.jar.*' missing from stdout/stderr 

and here is a line from the output:

16316 C:\\local\\aurora\\sandbox\\results\\workDir\\sun\\tools\\jps\\TestJpsJar\\JpsBase.jar

Note that the pattern is looking for '.*' after JpsBase.jar
the output line has nothing after JpsBase.jar.
Comments
This test is failing on jdk9/dev (for testset pit). If they fix only involves modifications to the test itself, then the fix should be pushed to jdk9/dev I'm raising the priority
05-07-2016

Result of jps -l depends to the value of user.dir property but result of File.getAbsolutePath() not. So if the same physical location is mapped or linked to different logical paths result of jps -l could be different from results of File.getAbsolutePath(). And the test fails because it gets C:\<path>\JpsBase.jar in jps -l output instead of expected E:\<path>\JpsBase.jar
28-06-2016