From 76c85f168edd49b10ea5114836160bd43c7c4a68 Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Tue, 18 Jun 2019 15:10:41 +0200 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(-) (limited to 'qa') 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