Stablize the annoyingi pt-table-checksum/basics.t tests that always change by insignificant amounts anytime we change something with sandboxes.

This commit is contained in:
Daniel Nichter
2013-02-18 18:51:14 -07:00
parent 923e643b04
commit 5bb577a75b
5 changed files with 28 additions and 37 deletions

View File

@@ -68,9 +68,7 @@ sub reset_repl_db {
ok(
no_diff(
sub { pt_table_checksum::main(@args) },
$sandbox_version gt "5.1 " ? "$sample/default-results-5.5.txt"
: $sandbox_version gt "5.0 " ? "$sample/default-results-5.1.txt"
: "$sample/default-results-5.0.txt",
"$sample/default-results-$sandbox_version.txt",
post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'',
),
"Default checksum"
@@ -81,10 +79,10 @@ ok(
# Since this varies by default, there's no use checking the checksums
# other than to ensure that there's at one for each table.
$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
cmp_ok(
$row->[0], '>=', ($sandbox_version gt "5.0" ? 37 : 33),
'At least 37 checksums'
);
ok(
$row->[0] > 30 && $row->[0] < 50,
'Between 30 and 50 chunks'
) or diag($row->[0]);
# ############################################################################
# Static chunk size (disable --chunk-time)
@@ -93,33 +91,24 @@ cmp_ok(
ok(
no_diff(
sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) },
$sandbox_version gt "5.1" ? "$sample/static-chunk-size-results-5.5.txt"
: $sandbox_version gt "5.0" ? "$sample/static-chunk-size-results-5.1.txt"
: "$sample/static-chunk-size-results-5.0.txt",
"$sample/static-chunk-size-results-$sandbox_version.txt",
post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'',
),
"Static chunk size (--chunk-time 0)"
);
$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
is(
$row->[0],
( $sandbox_version ge "5.6" ? 89
: $sandbox_version gt "5.1" ? 90
: $sandbox_version gt "5.0" ? 89
: 85),
'Expected checksums on master'
);
ok(
$row->[0] >= 85 && $row->[0] <= 90,
'Between 85 and 90 chunks on master'
) or diag($row->[0]);
$row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums");
my $row2 = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums");
is(
$row2->[0],
$row->[0],
( $sandbox_version ge "5.6" ? 89
: $sandbox_version gt "5.1" ? 90
: $sandbox_version gt "5.0" ? 89
: 85),
'Expected checksums on slave'
);
'... same number of chunks on slave'
) or diag($row->[0], ' ', $row2->[0]);
# ############################################################################
# --[no]replicate-check and, implicitly, the tool's exit status.

View File

@@ -20,7 +20,7 @@ ERRORS DIFFS ROWS SKIPPED TABLE
0 0 0 0 mysql.time_zone_transition
0 0 0 0 mysql.time_zone_transition_type
0 0 2 0 mysql.user
0 0 39 0 percona_test.checksums
0 0 37 0 percona_test.checksums
0 0 1 0 percona_test.load_data
0 0 1 0 percona_test.sentinel
0 0 200 0 sakila.actor

View File

@@ -3,10 +3,11 @@ ERRORS DIFFS ROWS SKIPPED TABLE
0 0 0 0 mysql.db
0 0 0 0 mysql.event
0 0 0 0 mysql.func
0 0 40 0 mysql.help_category
0 0 473 0 mysql.help_keyword
0 0 1045 0 mysql.help_relation
0 0 529 0 mysql.help_topic
0 0 38 0 mysql.help_category
0 0 453 0 mysql.help_keyword
0 0 992 0 mysql.help_relation
0 0 220 0 mysql.help_topic
0 0 0 0 mysql.host
0 0 0 0 mysql.ndb_binlog_index
0 0 0 0 mysql.plugin
0 0 0 0 mysql.proc
@@ -20,7 +21,7 @@ ERRORS DIFFS ROWS SKIPPED TABLE
0 0 0 0 mysql.time_zone_transition
0 0 0 0 mysql.time_zone_transition_type
0 0 2 0 mysql.user
0 0 37 0 percona_test.checksums
0 0 38 0 percona_test.checksums
0 0 1 0 percona_test.load_data
0 0 1 0 percona_test.sentinel
0 0 200 0 sakila.actor

View File

@@ -20,7 +20,7 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
0 0 0 1 0 mysql.time_zone_transition
0 0 0 1 0 mysql.time_zone_transition_type
0 0 2 1 0 mysql.user
0 0 39 1 0 percona_test.checksums
0 0 37 1 0 percona_test.checksums
0 0 1 1 0 percona_test.load_data
0 0 1 1 0 percona_test.sentinel
0 0 200 1 0 sakila.actor

View File

@@ -3,10 +3,11 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
0 0 0 1 0 mysql.db
0 0 0 1 0 mysql.event
0 0 0 1 0 mysql.func
0 0 40 1 0 mysql.help_category
0 0 473 1 0 mysql.help_keyword
0 0 1045 1 0 mysql.help_relation
0 0 529 1 0 mysql.help_topic
0 0 38 1 0 mysql.help_category
0 0 453 1 0 mysql.help_keyword
0 0 992 1 0 mysql.help_relation
0 0 220 1 0 mysql.help_topic
0 0 0 1 0 mysql.host
0 0 0 1 0 mysql.ndb_binlog_index
0 0 0 1 0 mysql.plugin
0 0 0 1 0 mysql.proc
@@ -20,7 +21,7 @@ ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
0 0 0 1 0 mysql.time_zone_transition
0 0 0 1 0 mysql.time_zone_transition_type
0 0 2 1 0 mysql.user
0 0 37 1 0 percona_test.checksums
0 0 38 1 0 percona_test.checksums
0 0 1 1 0 percona_test.load_data
0 0 1 1 0 percona_test.sentinel
0 0 200 1 0 sakila.actor