mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-18 16:40:23 +00:00
t/pt-table-sync/wait.t: use wait_until() instead of sleep()
This commit is contained in:
@@ -61,15 +61,13 @@ if ( !$pid ) {
|
||||
}
|
||||
|
||||
# parent
|
||||
sleep 4; # give time slave to become lagged
|
||||
|
||||
my $lag = $slave_dbh->selectrow_hashref("show slave status");
|
||||
|
||||
if ( !$lag->{seconds_behind_master} ) {
|
||||
PerconaTest::wait_until(sub {
|
||||
$slave_dbh->selectrow_hashref("show slave status")->{seconds_behind_master}
|
||||
}) or do {
|
||||
kill 15, $pid;
|
||||
waitpid ($pid, 0);
|
||||
die "Slave did not lag";
|
||||
}
|
||||
};
|
||||
|
||||
my $start = time;
|
||||
|
||||
@@ -93,14 +91,13 @@ cmp_ok(
|
||||
);
|
||||
|
||||
# Repeat the test with --wait 0 to test that the sync happens without delay.
|
||||
|
||||
$lag = $slave_dbh->selectrow_hashref("show slave status");
|
||||
|
||||
if ( !$lag->{seconds_behind_master} ) {
|
||||
PerconaTest::wait_until(sub {
|
||||
$slave_dbh->selectrow_hashref("show slave status")->{seconds_behind_master}
|
||||
}) or do {
|
||||
kill 15, $pid;
|
||||
waitpid ($pid, 0);
|
||||
die "Slave is not lagged";
|
||||
}
|
||||
die "Slave did not lag";
|
||||
};
|
||||
|
||||
$start = time;
|
||||
|
||||
|
Reference in New Issue
Block a user