8282379: [LOOM] vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011 sometimes fails

Reviewed-by: dholmes, sspitsyn
This commit is contained in:
Chris Plummer 2023-02-09 18:25:04 +00:00
parent 7fd440d97c
commit f4b72df428
15 changed files with 115 additions and 23 deletions

@ -82,8 +82,6 @@ vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java 8300707 generic-all
####
## NSK JDI tests failing with wrapper
vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011/TestDescription.java 8282379 generic-all
####
## The test expects an NPE to be uncaught, but nsk.share.MainWrapper
## introduces exception handlers.

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -209,6 +209,16 @@ public class invokemethod011 {
clsType.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,11 +87,15 @@ public class invokemethod011t {
static volatile boolean isInvoked = false;
static long dummyMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod011t.log.display("dummyMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod011t.log.display("dummyMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -202,6 +202,15 @@ public class invokemethod012 {
clsType.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after the method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -89,11 +89,15 @@ public class invokemethod012t {
static volatile boolean isInvoked = false;
static long dummyMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod012t.log.display("dummyMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod012t.log.display("dummyMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -204,6 +204,15 @@ public class invokemethod013 {
// finish the invocation
clsRef.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after the method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,11 +88,15 @@ public class invokemethod013t {
static volatile boolean isInvoked = false;
static long dummyMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod013t.log.display("dummyMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod013t.log.display("dummyMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -206,6 +206,16 @@ public class invokemethod010 {
objRef.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -181,11 +181,15 @@ class invokemethod010tDummyClass {
volatile boolean isInvoked = false;
long longMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod010t.log.display("invokemethod010tDummyClass: longMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod010t.log.display("invokemethod010tDummyClass: longMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -206,6 +206,16 @@ public class invokemethod011 {
objRef.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -181,11 +181,15 @@ class invokemethod011tDummyClass {
volatile boolean isInvoked = false;
long longMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod011t.log.display("invokemethod011tDummyClass: longMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod011t.log.display("invokemethod011tDummyClass: longMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -206,6 +206,15 @@ public class invokemethod012 {
objRef.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after the method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -181,11 +181,15 @@ class invokemethod012tDummyClass {
volatile boolean isInvoked = false;
long longMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod012t.log.display("invokemethod012tDummyClass: longMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod012t.log.display("invokemethod012tDummyClass: longMeth: exiting");
isInvoked = false;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -207,6 +207,15 @@ public class invokemethod013 {
objRef.setValue(fldToExit, vm.mirrorOf(true));
invThr.join(argHandler.getWaitTime()*60000);
if (invThr.isAlive()) {
// The join failed because the invoke never completed.
log.complain("TEST FAILED: invoke never completed");
tot_res = Consts.TEST_FAILED;
// Do a vm.resume() to see if that helps.
vm.resume();
invThr.join(); // let test time out if this fails
return quitDebuggee();
}
log.display("Thread \"" + invThr.getName() + "\" done");
// check threads status after the method invocation

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -180,11 +180,15 @@ class invokemethod013tDummyClass {
volatile boolean isInvoked = false;
long longMeth(long l) throws InterruptedException {
/*
* WARNING: Since this method is called using INVOKE_SINGLE_THREADED, we need to
* be careful not to do anything that might block on another thread. That includes
* calling Thread.sleep(), which can be a problem for virtual threads.
*/
invokemethod013t.log.display("invokemethod013tDummyClass: longMeth: going to loop");
isInvoked = true;
while(!doExit) {
l--; l++;
Thread.currentThread().sleep(400);
}
invokemethod013t.log.display("invokemethod013tDummyClass: longMeth: exiting");
isInvoked = false;