Skip to content

Commit

Permalink
ftest: Flush stderr before writing status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Aug 10, 2023
1 parent 11eeba1 commit 46f0d6e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import org.junit.platform.launcher.listeners.TestExecutionSummary
* @author Ruud Senden
*/
public class TestRunner {
static def orgOut = System.out
static def orgErr = System.err
static PrintStream orgOut = System.out
static PrintStream orgErr = System.err
public static void main(String[] args) {
setSystemProperties(args)
def exitCode = 0
Expand Down Expand Up @@ -109,6 +109,7 @@ public class TestRunner {
}
}
private void logStatus(String msg) {
orgErr.flush(); // Make sure all error output has been printed before outputting status message
def msgWithPrefix = logPrefixFormat.format(new Date()) + msg;
orgOut.println(msgWithPrefix)
log.println(msgWithPrefix)
Expand Down

0 comments on commit 46f0d6e

Please sign in to comment.