From 3df46a1054c7ec37f8ef651a078ded741c991ddd Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Mon, 1 Jul 2019 14:43:38 +0000 Subject: QA: Make shellout more responsive Avoid line-buffering and flush each character during shellout. This useful for commands (e.g. gcloud) which display its progress by printing single dots. --- qa/qa/service/shellout.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/qa/service/shellout.rb b/qa/qa/service/shellout.rb index 7065ab0e7f3..217df669db3 100644 --- a/qa/qa/service/shellout.rb +++ b/qa/qa/service/shellout.rb @@ -19,7 +19,7 @@ module QA Open3.popen2e(*command) do |stdin, out, wait| stdin.puts(stdin_data) if stdin_data stdin.close if stdin_data - out.each { |line| puts line } + out.each_char { |char| print char } if wait.value.exited? && wait.value.exitstatus.nonzero? raise CommandError, "Command `#{command}` failed!" -- cgit v1.2.1