PT-2295 - Fix tests on distributions

- Fixed sporadic pt-tc failures on rolled back SHOW MASTER STATUS code
- Added better diagnostic info for sporadically failing t/pt-table-checksum/basics.t
- Decreased chunk size it t/pt-table-checksum/progress.t, so this test
  has less chances to fail, because pt-osc finishes faster than expected
This commit is contained in:
Sveta Smirnova
2024-02-08 17:06:10 +03:00
parent d07d6c00ff
commit 19baa34872
6 changed files with 43 additions and 20 deletions

View File

@@ -173,6 +173,25 @@ parse_options "$BIN_DIR/pt-stalk" --run-time 2 -- --defaults-file=/tmp/12345/my.
rm $PT_TMPDIR/collect/*
collect "$PT_TMPDIR/collect" "2011_12_05" > $p-output 2>&1
cat $p-output
iters=$(cat $p-df | grep -c '^TS ')
is "$iters" "2" "2 iteration/2s run time"
if [ -f "$p-vmstat" ]; then
n=$(awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$p-vmstat")
is \
"$n" \
"2" \
"vmstat runs for --run-time seconds (bug 955860)"
else
is "1" "1" "SKIP vmstat not installed"
fi
rm $PT_TMPDIR/collect/*
fake_opcontrol="$PT_TMPDIR/collect/fake_opcontrol"
fake_out="$PT_TMPDIR/collect/pt-faked-opcontrol-out"
cat <<FAKE_EXEC > "$fake_opcontrol"
@@ -192,25 +211,13 @@ collect "$PT_TMPDIR/collect" "2011_12_05" > $p-output 2>&1
CMD_OPCONTROL=""
OPT_COLLECT_OPROFILE=""
cat $p-df | grep -c '^TS '
iters=$(cat $p-df | grep -c '^TS ')
is "$iters" "2" "2 iteration/2s run time"
is \
"$(cat "$fake_out")" \
"Faked opcontrol: --init" \
"Bug 986847: Can manually set which commands pt-stalk uses"
if [ -f "$p-vmstat" ]; then
n=$(awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$p-vmstat")
is \
"$n" \
"2" \
"vmstat runs for --run-time seconds (bug 955860)"
else
is "1" "1" "SKIP vmstat not installed"
fi
# ############################################################################
# Done
# ############################################################################
rm $PT_TMPDIR/collect/*

View File

@@ -85,16 +85,18 @@ sub reset_repl_db {
# So we will re-run failed code if test does not pass.
my $cmd = sub { pt_table_checksum::main(@args) };
diag(output($cmd)) if not ok(
#diag(output($cmd))
ok(
no_diff(
$cmd,
"$sample/default-results-$sandbox_version.txt",
sed_out => '\'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d\'',
post_pipe => 'sed \'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d; /mysql.ndb_binlog_index$/d; /mysql.global_grants$/d\' | ' .
'awk \'{print $2 " " $3 " " $4 " " $7 " " $9}\'',
keep_ouput => 1,
),
"Default checksum"
);
) or diag($test_diff);
# On fast machines, the chunk size will probably be be auto-adjusted so
# large that all tables will be done in a single chunk without an index.

View File

@@ -48,7 +48,7 @@ else {
# worse. This is a random stab in the dark. There is a problem either way.)
my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
my @args = ($master_dsn, qw(--set-vars innodb_lock_wait_timeout=3),
'--chunk-size', '200');
'--chunk-size', '50');
my $output;
my $row;
my $scripts = "$trunk/t/pt-table-checksum/scripts/";
@@ -83,7 +83,7 @@ like(
$output,
qr/Replica h=127.0.0.1,P=12347 is stopped/,
"--progress for slave lag"
);
) or diag($output);
like(
$output,