mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 14:18:32 +00:00
Tweak t/lib/bash/collect.sh and t/lib/bash/report_mysql_info.sh and add wait_for_files() to util/test-bash-functions so hopefully they'll be more stable.
This commit is contained in:
@@ -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
|
||||
|
@@ -107,8 +107,8 @@ cat <<EOF > $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
|
||||
|
@@ -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
|
||||
# ############################################################################
|
||||
|
Reference in New Issue
Block a user