From 46f0d6e3dce92b90f47a683315d852a66c692265 Mon Sep 17 00:00:00 2001 From: Ruud Senden <8635138+rsenden@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:53:33 +0200 Subject: [PATCH] ftest: Flush stderr before writing status messages --- .../src/ftest/groovy/com/fortify/cli/ftest/TestRunner.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/TestRunner.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/TestRunner.groovy index 980618f332..7dcd912fe0 100644 --- a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/TestRunner.groovy +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/TestRunner.groovy @@ -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 @@ -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)