8211931: [ppc][testbug] runtime/jni/terminatedThread/TestTerminatedThread.java fails as threads don't terminate immediately

Reviewed-by: dholmes, mdoerr
diff --git a/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java b/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java
index 1cc79fa..df8e68e 100644
--- a/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java
+++ b/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java
@@ -85,10 +85,14 @@
             System.out.println("Calling getThreadCpuTime ...");
             long t1 = mbean.getThreadCpuTime(t.getId());
             if (t1 != -1) {
-                throw new RuntimeException("Invalid ThreadCpuTime returned = " +
-                                           t1 + " expected = -1");
+                // At least on PPC, we know threads can still be around a short
+                // instant. In some stress scenarios we seem to grab times of
+                // new threads started with the same thread id. In these cases
+                // we get here.
+                System.out.println("Unexpected: thread still reports CPU time: " + t1);
+            } else {
+                System.out.println("Okay: getThreadCpuTime() reported -1 as expected");
             }
-            System.out.println("Okay: getThreadCpuTime() reported -1 as expected");
         } else {
             System.out.println("Skipping Thread CPU time test as it's not supported");
         }
@@ -96,10 +100,14 @@
         System.out.println("Calling getThreadUserTime ...");
         long t1 = mbean.getThreadUserTime(t.getId());
         if (t1 != -1) {
-            throw new RuntimeException("Invalid ThreadUserTime returned = " +
-                                       t1 + " expected = -1");
+            // At least on PPC, we know threads can still be around a short
+            // instant. In some stress scenarios we seem to grab times of
+            // new threads started with the same thread id. In these cases
+            // we get here.
+            System.out.println("Unexpected: thread still reports User time: " + t1);
+        } else {
+            System.out.println("Okay: getThreadUserTime() reported -1 as expected");
         }
-        System.out.println("Okay: getThreadUserTime() reported -1 as expected");
 
         System.out.println("Calling getThreadInfo ...");
         ThreadInfo info = mbean.getThreadInfo(t.getId());