8210725: com/sun/jdi/RedefineClearBreakpoint.java fails with waitForPrompt timed out after 60 seconds

8210748: [TESTBUG] lib.jdb.Jdb.waitForPrompt() should clarify which output is the pending reply after a timeout

Reviewed-by: jcbeyler, gadams, sspitsyn
This commit is contained in:
Alex Menkov 2018-09-21 10:18:12 -07:00
parent 159a4de4c8
commit b0a7fa474f
2 changed files with 10 additions and 5 deletions

View File

@ -73,9 +73,9 @@ public class Jdb implements AutoCloseable {
private static final String lineSeparator = System.getProperty("line.separator");
// wait time before check jdb output (in ms)
private static long sleepTime = 1000;
private static final long sleepTime = 1000;
// max time to wait for jdb output (in ms)
private static long timeout = 60000;
private static final long timeout = Utils.adjustTimeout(60000);
// pattern for message of a breakpoint hit
public static final String BREAKPOINT_HIT = "Breakpoint hit:";
@ -215,7 +215,7 @@ public class Jdb implements AutoCloseable {
throw new RuntimeException("Attempt to send command '" + cmd.cmd + "' to terminated jdb");
}
System.out.println("> " + cmd.cmd);
log("> " + cmd.cmd);
inputWriter.println(cmd.cmd);
@ -251,13 +251,13 @@ public class Jdb implements AutoCloseable {
command(JdbCommand.quit());
}
private void log(String s) {
void log(String s) {
System.out.println(s);
}
private void logJdb(List<String> reply) {
jdbOutput.addAll(reply);
reply.forEach(s -> System.out.println("[jdb] " + s));
reply.forEach(s -> log("[jdb] " + s));
}
// returns the whole jdb output as a string

View File

@ -94,6 +94,11 @@ public abstract class JdbTest {
try {
setup();
runCases();
} catch (Throwable e) {
jdb.log("=======================================");
jdb.log("Exception thrown during test execution: " + e.getMessage());
jdb.log("=======================================");
throw e;
} finally {
shutdown();
}