8044818: [TESTBUG] runtime/CDSCompressedKPtrs/XShareAuto.java fails with RuntimeException 'sharing' found in stderr
authordholmes
Sun, 22 Jun 2014 21:23:32 -0400
changeset 25332 de966f7475d6
parent 25331 59a7d98a5268
child 25333 078d0ef28601
8044818: [TESTBUG] runtime/CDSCompressedKPtrs/XShareAuto.java fails with RuntimeException 'sharing' found in stderr Reviewed-by: hseigel, lfoltan, coleenp, dholmes Contributed-by: Pavel Chistyakov <pavel.chistyakov@oracle.com>
hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
--- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Wed Jun 18 12:35:32 2014 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Sun Jun 22 21:23:32 2014 -0400
@@ -44,8 +44,16 @@
             "-server", "-XX:+UnlockDiagnosticVMOptions",
             "-XX:SharedArchiveFile=./sample.jsa", "-version");
         output = new OutputAnalyzer(pb.start());
-        output.shouldNotContain("sharing");
-        output.shouldHaveExitValue(0);
+        // We asked for server but it could be aliased to something else
+        if (output.getOutput().contains("Server VM")) {
+            // In server case we don't expect to see sharing flag
+            output.shouldNotContain("sharing");
+            output.shouldHaveExitValue(0);
+        }
+        else {
+            System.out.println("Skipping test - no Server VM available");
+            return;
+        }
 
         pb = ProcessTools.createJavaProcessBuilder(
             "-server", "-Xshare:auto", "-XX:+UnlockDiagnosticVMOptions",