Attempt to avoid race condition in t/pt-table-checksum/progress.t by slowing down the checksum job slightly, but this is a TEST_WISHLIST PLUGIN_WISHLIST and this test goes onto the spreadsheet of unreliable tests.

This commit is contained in:
Baron Schwartz
2012-06-05 00:09:31 -04:00
parent d8d019aecc
commit 2d33ba23dc
2 changed files with 29 additions and 3 deletions

View File

@@ -55,6 +55,8 @@ our @EXPORT = qw(
parse_file
wait_until
wait_for
wait_until_slave_running
wait_until_no_lag
test_log_parser
test_protocol_parser
test_packet_parser
@@ -243,6 +245,22 @@ sub wait_until {
return 0;
}
sub wait_until_slave_running {
my (@dbhs) = @_;
foreach my $dbh (@dbhs) {
PTDEVDEBUG && _d('Waiting for slaves to be running');
wait_until(
sub {
my $row = $dbh->selectrow_hashref('SHOW SLAVE STATUS');
my $sqlt = $row->{slave_sql_running} || $row->{Slave_SQL_Running} || 'NULL';
my $iot = $row->{Slave_IO_Running} || $row->{slave_io_running} || 'NULL';
PTDEVDEBUG && _d('Slave SQL:', $sqlt, 'Slave IO:', $iot);
return $sqlt eq 'Yes' && $iot eq 'Yes';
}
);
}
}
sub wait_until_no_lag {
my (@dbhs) = @_;
foreach my $dbh (@dbhs) {