diff --git a/t/lib/bash/collect.sh b/t/lib/bash/collect.sh index b7e4fe88..f9f976fd 100644 --- a/t/lib/bash/collect.sh +++ b/t/lib/bash/collect.sh @@ -23,6 +23,8 @@ p="$PT_TMPDIR/collect/2011_12_05" # Default collect, no extras like gdb, tcpdump, etc. collect "$PT_TMPDIR/collect" "2011_12_05" > $p-output 2>&1 +wait_for_files "$p-hostname" "$p-opentables2" "$p-variables" + # Even if this system doesn't have all the cmds, collect should still # have created some files for cmds that (hopefully) all systems have. ls -1 $PT_TMPDIR/collect | sort > $PT_TMPDIR/collect-files diff --git a/t/lib/bash/report_mysql_info.sh b/t/lib/bash/report_mysql_info.sh index e3c260f2..ee87dd0c 100644 --- a/t/lib/bash/report_mysql_info.sh +++ b/t/lib/bash/report_mysql_info.sh @@ -107,8 +107,8 @@ cat < $PT_TMPDIR/expected EOF summarize_processlist "$samples/processlist-001.txt" > "$PT_TMPDIR/got" -no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "summarize_processlist" - +no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "summarize_processlist" \ + || cat "$PT_TMPDIR/got" "$PT_TMPDIR/expected" >&2 # ########################################################################### # summarize_binlogs @@ -548,7 +548,8 @@ Mutexes/Locks Waited For EOF format_innodb_status $samples/innodb-status.001.txt > $PT_TMPDIR/got -no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.001.txt" +no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.001.txt" \ + || cat "$PT_TMPDIR/got" "$PT_TMPDIR/expected" >&2 cat <<'EOF' > $PT_TMPDIR/expected Checkpoint Age | 348M @@ -600,7 +601,8 @@ Tables Locked EOF format_innodb_status $samples/innodb-status.003.txt > $PT_TMPDIR/got -no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.003.txt" +no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.003.txt" \ + || cat "$PT_TMPDIR/got" "$PT_TMPDIR/expected" >&2 cat <<'EOF' > $PT_TMPDIR/expected Checkpoint Age | 93M @@ -628,7 +630,8 @@ Mutexes/Locks Waited For EOF format_innodb_status $samples/innodb-status.004.txt > $PT_TMPDIR/got -no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.004.txt" +no_diff $PT_TMPDIR/got $PT_TMPDIR/expected "innodb-status.004.txt" \ + || cat "$PT_TMPDIR/got" "$PT_TMPDIR/expected" >&2 # ########################################################################### # section_innodb diff --git a/util/test-bash-functions b/util/test-bash-functions index 0e715522..133aab74 100755 --- a/util/test-bash-functions +++ b/util/test-bash-functions @@ -198,6 +198,19 @@ dies_ok() { result $result "$test_name" } +# Helper subs for slow boxes + +wait_for_files() { + for file in "$@"; do + local slept=0 + while ! [ -f $file ]; do + sleep 0.1; + slept=$((slept + 1)) + [ $slept -ge 50 ] && break # 5s + done + done +} + # ############################################################################ # Script starts here # ############################################################################