6737900: TEST: Some JDI regression tests timeout on slow machines
Don't execute useless code, and split test into multiple @runs. Reviewed-by: tbell
This commit is contained in:
parent
4a362b1ee2
commit
1c42f2e0d3
@ -134,10 +134,11 @@ public class ClassesByName2Test extends TestScaffold {
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* resume the target listening for events
|
||||
*/
|
||||
listenUntilVMDisconnect();
|
||||
|
||||
|
||||
// Doing vm().exit(0) instead of listenUntilVMDisconnect()
|
||||
// speeds up the test up by more than 50% in -server -Xcomp (solsparc32-fastdebug)
|
||||
vm().exit(0);
|
||||
|
||||
/*
|
||||
* deal with results of test
|
||||
|
@ -28,7 +28,10 @@
|
||||
*
|
||||
* @run build TestScaffold VMConnection TargetListener TargetAdapter
|
||||
* @run compile -g InstTarg.java
|
||||
* @run main ConnectedVMs InstTarg
|
||||
* @run main ConnectedVMs "Kill"
|
||||
* @run main ConnectedVMs "Resume to exit"
|
||||
* @run main ConnectedVMs "dispose()"
|
||||
* @run main ConnectedVMs "exit()"
|
||||
*
|
||||
* @summary ConnectedVMs checks the method
|
||||
* VirtualMachineManager.connectedVirtualMachines()
|
||||
@ -40,14 +43,10 @@ import java.util.List;
|
||||
|
||||
public class ConnectedVMs extends TestScaffold {
|
||||
static int failCount = 0;;
|
||||
static int pass;
|
||||
static String[] passNames = {"Kill", "Resume to exit",
|
||||
"dispose()", "exit()"};
|
||||
static String passName;
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
for (pass=0; pass < passNames.length; pass++) {
|
||||
new ConnectedVMs(args).startTests();
|
||||
}
|
||||
new ConnectedVMs(args[0]).startTests();
|
||||
if (failCount > 0) {
|
||||
throw new RuntimeException(
|
||||
"VirtualMachineManager.connectedVirtualMachines() " +
|
||||
@ -58,16 +57,17 @@ public class ConnectedVMs extends TestScaffold {
|
||||
}
|
||||
}
|
||||
|
||||
ConnectedVMs(String args[]) throws Exception {
|
||||
super(args);
|
||||
System.out.println("create");
|
||||
ConnectedVMs(String name) throws Exception {
|
||||
super(new String[0]);
|
||||
passName = name;
|
||||
System.out.println("create " + passName);
|
||||
}
|
||||
|
||||
void vms(int expected) {
|
||||
List vms = Bootstrap.virtualMachineManager().
|
||||
connectedVirtualMachines();
|
||||
if (vms.size() != expected) {
|
||||
System.out.println("FAILURE! " + passNames[pass] +
|
||||
System.out.println("FAILURE! " + passName +
|
||||
" - expected: " + expected +
|
||||
", got: " + vms.size());
|
||||
++failCount;
|
||||
@ -75,27 +75,22 @@ public class ConnectedVMs extends TestScaffold {
|
||||
}
|
||||
|
||||
protected void runTests() throws Exception {
|
||||
System.out.println("Testing " + passNames[pass]);
|
||||
System.out.println("Testing " + passName);
|
||||
vms(0);
|
||||
startToMain("InstTarg");
|
||||
ThreadReference thread = waitForVMStart();
|
||||
StepEvent stepEvent = stepIntoLine(thread);
|
||||
vms(1);
|
||||
|
||||
// pick a way to die
|
||||
switch (pass) {
|
||||
case 0:
|
||||
vm().process().destroy();
|
||||
break;
|
||||
case 1:
|
||||
vm().resume();
|
||||
break;
|
||||
case 2:
|
||||
vm().dispose();
|
||||
break;
|
||||
case 3:
|
||||
vm().exit(1);
|
||||
break;
|
||||
// pick a way to die based on the input arg.
|
||||
if (passName.equals("Kill")) {
|
||||
vm().process().destroy();
|
||||
} else if (passName.equals("Resume to exit")) {
|
||||
vm().resume();
|
||||
} else if (passName.equals("dispose()")) {
|
||||
vm().dispose();
|
||||
} else if (passName.equals("exit()")) {
|
||||
vm().exit(1);
|
||||
}
|
||||
|
||||
resumeToVMDisconnect();
|
||||
|
@ -10,7 +10,11 @@
|
||||
* @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
|
||||
* @run compile MangleStepTest.java
|
||||
* @run compile -g onion/pickle/Mangle.java
|
||||
* @run main MangleStepTest unset Java XYZ Rats bogus
|
||||
* @run main MangleStepTest unset
|
||||
* @run main MangleStepTest Java
|
||||
* @run main MangleStepTest XYZ
|
||||
* @run main MangleStepTest Rats
|
||||
* @run main MangleStepTest bogus
|
||||
*/
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
@ -32,9 +36,7 @@ public class MangleStepTest extends TestScaffold {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
testSetUp();
|
||||
for (int i = 0; i < args.length; ++i) {
|
||||
new MangleStepTest(args[i]).startTests();
|
||||
}
|
||||
new MangleStepTest(args[0]).startTests();
|
||||
if (aTestFailed) {
|
||||
throw new Exception("MangleStepTest: failed");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user