mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-12 08:53:12 +00:00
7153107: com/sun/jdi/InterruptHangTest.java fails in nightlies
Increased timeouts and added timestamped logging Reviewed-by: sspitsyn
This commit is contained in:
parent
c5f2279354
commit
304d3c93fd
@ -153,14 +153,17 @@ public class InterruptHangTest extends TestScaffold {
|
||||
timerThread = new Thread("test timer") {
|
||||
public void run() {
|
||||
int mySteps = 0;
|
||||
float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
|
||||
long sleepSeconds = (long)(20 * timeoutFactor);
|
||||
println("Timer watching for steps every " + sleepSeconds + " seconds");
|
||||
while (true) {
|
||||
try {
|
||||
Thread.sleep(20000);
|
||||
Thread.sleep(sleepSeconds * 1000);
|
||||
synchronized(sync) {
|
||||
System.out.println("steps = " + nSteps);
|
||||
println("steps = " + nSteps);
|
||||
if (mySteps == nSteps) {
|
||||
// no step for 10 secs
|
||||
failure("failure: Debuggee appears to be hung");
|
||||
// no step for a long time
|
||||
failure("failure: Debuggee appears to be hung (no steps for " + sleepSeconds + "s)");
|
||||
vm().exit(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -64,6 +64,7 @@ abstract public class TestScaffold extends TargetAdapter {
|
||||
boolean vmDisconnected = false;
|
||||
final String[] args;
|
||||
protected boolean testFailed = false;
|
||||
protected long startTime;
|
||||
|
||||
static private class ArgInfo {
|
||||
String targetVMArgs = "";
|
||||
@ -425,6 +426,7 @@ abstract public class TestScaffold extends TargetAdapter {
|
||||
abstract protected void runTests() throws Exception;
|
||||
|
||||
final public void startTests() throws Exception {
|
||||
startTime = System.currentTimeMillis();
|
||||
try {
|
||||
runTests();
|
||||
} finally {
|
||||
@ -433,7 +435,8 @@ abstract public class TestScaffold extends TargetAdapter {
|
||||
}
|
||||
|
||||
protected void println(String str) {
|
||||
System.err.println(str);
|
||||
long elapsed = System.currentTimeMillis() - startTime;
|
||||
System.err.println("[" + elapsed + "ms] " + str);
|
||||
}
|
||||
|
||||
protected void print(String str) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user