# HG changeset patch # User goetz # Date 1539256029 -7200 # Thu Oct 11 13:07:09 2018 +0200 # Node ID b70d6f286f6406cb10f2cb6a0c1623e0b071060e # Parent d24b89390f6c718c41beab8e04f9bb6127acac1c 8211931: [ppc][testbug] runtime/jni/terminatedThread/TestTerminatedThread.java fails as threads don't terminate immediately diff --git a/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java b/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java --- 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());