Repository: kudu
Updated Branches:
  refs/heads/master 0ddb860d0 -> 5df9c9e0f treat empty gzipped output files as text files

I saw a test run where pstack_watcher-test timed out and gzip didn't produce
any output. Thus, we ended up with an empty pstack_watcher-test.txt.gz file
which is corrupt by definition; there should at least be a gzip header.

If this happens, let's treat the empty file as an empty text file so that
subsequent output file post-processing (which uses commands like zcat/zgrep)
doesn't fail.

Importantly, the pstack_watcher-test timeout does NOT benefit from this fix.
That's because pstack_watcher-test was being traced by gdb, so it couldn't
deliver itself a SIGABRT to timeout after 900 seconds. Instead, ctest killed
it after 930 seconds by sending a SIGKILL to itself, thus
preventing this cleanup code from running.

Change-Id: I0fbe13982412f9113b27afbc40635f8945c45f09
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <>


Branch: refs/heads/master
Commit: 3aa1070eef3bf981b87084c2a9ea91ca881829f6
Parents: 0ddb860
Author: Adar Dembo <>
Authored: Thu Apr 12 10:12:07 2018 -0700
Committer: Todd Lipcon <>
Committed: Fri Apr 13 19:53:59 2018 +0000

 build-support/ | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/build-support/ b/build-support/
index dd91c1e..bd33b6b 100755
--- a/build-support/
+++ b/build-support/
@@ -184,6 +184,15 @@ for ATTEMPT_NUMBER in $(seq 1 $TEST_EXECUTION_ATTEMPTS) ; 
     | $pipe_cmd > $LOGFILE
+  # An empty gzipped file is corrupt because even a logically empty gzipped 
+  # should contain at least the gzip header. If we detect this, treat the test
+  # log output as a plain text file.
+  if [[ -f $LOGFILE && ! -s $LOGFILE && $LOGFILE =~ .gz$ ]]; then
+  fi
   # TSAN doesn't always exit with a non-zero exit code due to a bug:
   # mutex errors don't get reported through the normal error reporting 
   # So we make sure to detect this and exit 1.

Reply via email to