diff mbox series

[lttng-tools] tap-driver.sh: flush stdout aftereach test result

Message ID 20190314154134.20191-1-mjeanson@efficios.com
State Accepted, archived
Delegated to: Jérémie Galarneau
Headers show
Series [lttng-tools] tap-driver.sh: flush stdout aftereach test result | expand

Commit Message

Michael Jeanson March 14, 2019, 3:41 p.m. UTC
This is useful in a CI system where stdout is fully buffered and you
look at the console output to see which test is hanging.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 config/tap-driver.sh | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jonathan Rajotte March 14, 2019, 4:32 p.m. UTC | #1
On Thu, Mar 14, 2019 at 11:41:34AM -0400, Michael Jeanson wrote:
> This is useful in a CI system where stdout is fully buffered and you
> look at the console output to see which test is hanging.
> 
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>

Acked-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>

> ---
>  config/tap-driver.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/config/tap-driver.sh b/config/tap-driver.sh
> index 32521614..65037ab6 100755
> --- a/config/tap-driver.sh
> +++ b/config/tap-driver.sh
> @@ -275,6 +275,9 @@ function report(result, details)
>      msg = msg " " details
>    # Output on console might be colorized.
>    print decorate_result(result) msg
> +  # Flush stdout after each test result, this is useful when stdout
> +  # is buffered, for example in a CI system.
> +  fflush()
>    # Log the result in the log file too, to help debugging (this is
>    # especially true when said result is a TAP error or "Bail out!").
>    print result msg | "cat >&3";
> -- 
> 2.17.1
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Jérémie Galarneau March 29, 2019, 6:31 p.m. UTC | #2
Merged in master, stable-2.11, stable-2.10, and stable-2.9.

Thanks!
J?r?mie

On Thu, Mar 14, 2019 at 11:41:34AM -0400, Michael Jeanson wrote:
> This is useful in a CI system where stdout is fully buffered and you
> look at the console output to see which test is hanging.
> 
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
>  config/tap-driver.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/config/tap-driver.sh b/config/tap-driver.sh
> index 32521614..65037ab6 100755
> --- a/config/tap-driver.sh
> +++ b/config/tap-driver.sh
> @@ -275,6 +275,9 @@ function report(result, details)
>      msg = msg " " details
>    # Output on console might be colorized.
>    print decorate_result(result) msg
> +  # Flush stdout after each test result, this is useful when stdout
> +  # is buffered, for example in a CI system.
> +  fflush()
>    # Log the result in the log file too, to help debugging (this is
>    # especially true when said result is a TAP error or "Bail out!").
>    print result msg | "cat >&3";
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/config/tap-driver.sh b/config/tap-driver.sh
index 32521614..65037ab6 100755
--- a/config/tap-driver.sh
+++ b/config/tap-driver.sh
@@ -275,6 +275,9 @@  function report(result, details)
     msg = msg " " details
   # Output on console might be colorized.
   print decorate_result(result) msg
+  # Flush stdout after each test result, this is useful when stdout
+  # is buffered, for example in a CI system.
+  fflush()
   # Log the result in the log file too, to help debugging (this is
   # especially true when said result is a TAP error or "Bail out!").
   print result msg | "cat >&3";