Hi Gary,
Removing 1st checkInfo (just after t_b.start()) looks good, but I don't
think 2nd checkInfo call should be dropped.
I'd rather added checkInfo for t_a after t_a.join()
Then the test will cover 3 cases - before thread is started, while
thread is running (checkInfo from thread.run()) and after thread
termination.
--alex
On 08/24/2018 05:19, Gary Adams wrote:
David pointed out the flaw in this test a long time ago, but
no one followed through to fix the test. When the test thread
runs to completion, there is no way to get the thread info
for the comparisons being made in checkInfo().
The test already calls checkInfo before starting the thread
and again in the test thread run method. The change below
will make the thrinfo001a and thrinfo001b tests perform the
same checking. It will avoid the race condition when thrinfo001b
finishes quickly.
Issue: https://bugs.openjdk.java.net/browse/JDK-8019927
diff --git
a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001.java
b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001.java
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001.java
@@ -69,11 +69,9 @@
t_b.setDaemon(true);
checkInfo(t_b, t_b.getThreadGroup(), 2);
t_b.start();
- checkInfo(t_b, t_b.getThreadGroup(), 2);
try {
t_b.join();
} catch (InterruptedException e) {}
- checkInfo(t_b, t_b.getThreadGroup(), 2);
return getRes();
}
}