Patch attached.

I think one reviewer is sufficient since this mimics
the cm02t001 bug fix.

On 10/8/18, 3:02 PM, Gary Adams wrote:
Hi Gary,

Looks good. Please add the comment "Wait for contended "sychronized (M)".

thanks,

Chris

On 10/8/18 4:47 AM, Gary Adams wrote:
>/  The main thread in tc02t001 is using a sleep(100) to cause a
/>/  monitor contention for the debuggee thread. On some slower
/>/  platform builds the main thread continues before the debuggee
/>/  thread observes the contention.
/>/
/>/  Similar to the fix for cm02t001, this is a simple change to increase
/>/  the pauses to allow the debuggee thread to run.
/>/
/>/     Webrev:http://cr.openjdk.java.net/~gadams/8201603/webrev/  
<http://cr.openjdk.java.net/%7Egadams/8201603/webrev/>
/>/     Issue:https://bugs.openjdk.java.net/browse/JDK-8201603
/


# HG changeset patch
# User gadams
# Date 1539025027 14400
#      Mon Oct 08 14:57:07 2018 -0400
# Node ID d238b3997d8f1c1a1552d936533a041534bf8a30
# Parent  f697ba5b18d2d011dbdc5438a6b1e2d451a41705
8201603: MonitorContendedEnter failure in 
nsk/jvmti/scenarios/contention/TC02/tc02t001
Reviewed-by: cjplummer

diff --git 
a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001.java
 
b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001.java
--- 
a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001.java
+++ 
b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001.java
@@ -71,7 +71,7 @@
 
             thread.waitingBarrier1.unlock();
             try {
-                Thread.sleep(100);
+                Thread.sleep(1000); // Wait for contended "synchronized (M)"
                 thread.M.wait(timeout);
             } catch (InterruptedException e) {
                 throw new Failure(e);
@@ -79,7 +79,7 @@
 
             thread.waitingBarrier2.unlock();
             try {
-                Thread.sleep(100);
+                Thread.sleep(1000); // Wait for contended "synchronized (M)"
                 thread.M.wait(timeout);
             } catch (InterruptedException e) {
                 throw new Failure(e);
@@ -87,7 +87,7 @@
 
             thread.waitingBarrier3.unlock();
             try {
-                Thread.sleep(100);
+                Thread.sleep(1000); // Wait for contended "synchronized (M)"
                 thread.M.wait(timeout);
             } catch (InterruptedException e) {
                 throw new Failure(e);

Reply via email to