RFR (S): 8230850: Test sun/tools/jcmd/TestProcessHelper.java fails intermittently

Langer, Christoph christoph.langer at sap.com
Wed Sep 11 12:37:45 UTC 2019


Hi,

please review this change for test sun/tools/jcmd/TestProcessHelper.java to make it more robust.

Bug: https://bugs.openjdk.java.net/browse/JDK-8230850
Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8230850.0/

This Linux only test is starting several Java processes and then tries to figure out the main class by invoking jdk.jcmd's linux specific ProcessHelper implementation which parses the contents of /proc/<pid>/cmdline.
Under some circumstances, the test already attempts to read /proc/<pid>/cmdline before it actually exists or is filled with data. This can be fixed with some sleeps/retries to wait for that data to be ready.
In the actual jcmd tool, such behavior of ProcessHelper. getMainClass should not be an issue because it is handled in ProcessArgumentMatcher [0].

Thanks
Christoph

[0] http://hg.openjdk.java.net/jdk/jdk/file/8b08eaf9a0eb/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java#l86

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190911/e56ca2d3/attachment.html>


More information about the serviceability-dev mailing list