test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java
changeset 48178 88ec5fca7726
parent 48113 af9e4669ca18
child 50791 b1e90a8a876c
--- a/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java	Thu Nov 30 21:28:12 2017 -0800
+++ b/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java	Fri Dec 01 11:40:39 2017 +0530
@@ -129,22 +129,16 @@
             throw new Error("Problem issuing the jstack command: " + str, ioe);
         }
 
+        OutputAnalyzer output = new OutputAnalyzer(p);
+
         try {
             p.waitFor();
         } catch (InterruptedException ie) {
+            p.destroyForcibly();
             throw new Error("Problem awaiting the child process: " + ie, ie);
         }
 
-        int exitValue = p.exitValue();
-        if (exitValue != 0) {
-            String output;
-            try {
-                output = new OutputAnalyzer(p).getOutput();
-            } catch (IOException ioe) {
-                throw new Error("Can't get failed clhsdb process output: " + ioe, ioe);
-            }
-            throw new AssertionError("clhsdb wasn't run successfully: " + output);
-        }
+        output.shouldHaveExitValue(0);
     }
 
     public static void main (String... args) throws Exception {