diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-06-18 15:10:41 +0200 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-06-18 15:10:41 +0200 |
commit | 76c85f168edd49b10ea5114836160bd43c7c4a68 (patch) | |
tree | 6948711d7029b3337c6b18d6d0d8933730f80d72 | |
parent | 28f7846c4723457c6d53808215796515396eaa7d (diff) | |
download | gitlab-ce-pl-qa-shell-flush-buffer.tar.gz |
QA: Make shellout more responsivepl-qa-shell-flush-buffer
Avoid line-buffering and flush each character during shellout.
This useful for commands (e.g. gcloud) which display its progress by
printing single dots.
-rw-r--r-- | qa/qa/service/shellout.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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!" |