Make pt-table-checksum/run_time.t more reliable.

This commit is contained in:
Daniel Nichter
2012-10-06 12:19:00 -06:00
parent 37450a6c28
commit 793296dfc9
+4 -4
View File
@@ -38,16 +38,16 @@ my @args = ($master_dsn, qw(--lock-wait-timeout 3), '--max-load', '');
my $output; my $output;
my $exit_status; my $exit_status;
# On my 2.4 GHz with SSD this takes a little more than 3s, # On my 2.4 GHz with SSD this takes a little more than 5s,
# so no test servers should be faster, hopefully. # so no test servers should be faster, hopefully.
my $t0 = time; my $t0 = time;
$exit_status = pt_table_checksum::main(@args, $exit_status = pt_table_checksum::main(@args,
qw(--quiet --quiet -d sakila --chunk-size 100 --run-time 1)); qw(--quiet --quiet -d sakila --chunk-size 50 --run-time 1));
my $t = time - $t0; my $t = time - $t0;
ok( ok(
$t >= 1.5 && $t <= 2.0, $t >= 1.5 && $t <= 2.5,
"Run in roughly --run-time 1 second" "Ran in roughly --run-time 1 second"
) or diag("Actual run time: $t"); ) or diag("Actual run time: $t");
my $rows = $master_dbh->selectall_arrayref("SELECT DISTINCT CONCAT(db, '.', tbl) FROM percona.checksums ORDER by db, tbl"); my $rows = $master_dbh->selectall_arrayref("SELECT DISTINCT CONCAT(db, '.', tbl) FROM percona.checksums ORDER by db, tbl");