Skip to content

Commit

Permalink
Attempt 1: make sure to always flush buffered logs (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg authored Aug 31, 2021
1 parent 9cfd8b1 commit 92f3ad9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public void testRunFinished(Result result)
", " +
result.getIgnoreCount()+" ignored" +
", "+result.getRunCount()+" total, "+(result.getRunTime()/1000.0)+"s") ;
logger.flush();
}
runStatistics.addTime(result.getRunTime());
}
Expand All @@ -174,7 +173,6 @@ public void testRunStarted(Description desc)
{
if (settings.verbose) {
logger.info(taskInfo + " started");
logger.flush();
}
}

Expand All @@ -183,7 +181,6 @@ void testExecutionFailed(String testName, Throwable err)
post(new Event(Ansi.c(testName, Ansi.ERRMSG), settings.buildErrorMessage(err), Status.Error, 0L, err) {
void logTo(RichLogger logger) {
logger.error(ansiName+" failed: "+ansiMsg, error);
logger.flush();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public Task[] execute(EventHandler eventHandler, Logger[] loggers) {
ed.testExecutionFailed(testClassName, ex);
}
} finally {
logger.flush();
settings.restoreSystemProperties(oldprops);
}
return new Task[0]; // junit tests do not nest
Expand Down

0 comments on commit 92f3ad9

Please sign in to comment.