8168412: Reduce buffering in jtreg timeouthandler

Reviewed-by: mlarsson
This commit is contained in:
Staffan Larsen 2016-10-21 15:40:47 +02:00
parent cef7022241
commit 5320830885
3 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ public class HtmlSection {
private HtmlSection(PrintWriter pw, String id, String name, HtmlSection rootSection) {
this.pw = pw;
textWriter = new PrintWriter(new HtmlFilterWriter(pw));
textWriter = new PrintWriter(new HtmlFilterWriter(pw), true);
this.id = id;
this.name = name;
child = null;

View File

@ -68,7 +68,7 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
boolean needClose = false;
try {
log = new PrintWriter(new FileWriter(
workDir.resolve(LOG_FILENAME).toFile(), true));
workDir.resolve(LOG_FILENAME).toFile(), true), true);
needClose = true;
} catch (IOException e) {
log = new PrintWriter(System.out);
@ -100,7 +100,7 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
EnvironmentInfoGatherer gatherer) {
File output = workDir.resolve(ENVIRONMENT_OUTPUT).toFile();
try (HtmlPage html = new HtmlPage(new PrintWriter(
new FileWriter(output, true)))) {
new FileWriter(output, true), true))) {
try (ElapsedTimePrinter timePrinter
= new ElapsedTimePrinter(new Stopwatch(), name, log)) {
gatherer.gatherEnvironmentInfo(html.getRootSection());

View File

@ -70,9 +70,9 @@ public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
String name = getClass().getName();
PrintWriter actionsLog;
try {
// try to open a separate file for aciton log
// try to open a separate file for action log
actionsLog = new PrintWriter(new FileWriter(
workDir.resolve(LOG_FILENAME).toFile(), true));
workDir.resolve(LOG_FILENAME).toFile(), true), true);
} catch (IOException e) {
// use jtreg log as a fallback
actionsLog = log;
@ -84,7 +84,7 @@ public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
File output = workDir.resolve(OUTPUT_FILENAME).toFile();
try {
PrintWriter pw = new PrintWriter(new FileWriter(output, true));
PrintWriter pw = new PrintWriter(new FileWriter(output, true), true);
runGatherer(name, workDir, actionsLog, pw, pid);
} catch (IOException e) {
actionsLog.printf("IOException: cannot open output file[%s] : %s",