mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-23 21:05:00 +00:00
Allow initial values to be zero for ReplicaLagLimiter::new(). Return 1/0/death from ReplicaLagLimiter::wait().
This commit is contained in:
@@ -38,7 +38,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 20;
|
||||
plan tests => 21;
|
||||
}
|
||||
|
||||
my $q = new Quoter();
|
||||
@@ -447,6 +447,27 @@ is_deeply(
|
||||
"Change chunk size while nibbling"
|
||||
) or print STDERR Dumper(\@rows);
|
||||
|
||||
# ############################################################################
|
||||
# Nibble one row at a time.
|
||||
# ############################################################################
|
||||
$ni = make_nibble_iter(
|
||||
sql_file => "a-z.sql",
|
||||
db => 'test',
|
||||
tbl => 't',
|
||||
argv => [qw(--databases test --chunk-size 1)],
|
||||
);
|
||||
|
||||
@rows = ();
|
||||
while (my $row = $ni->next()) {
|
||||
push @rows, @$row;
|
||||
}
|
||||
|
||||
is_deeply(
|
||||
\@rows,
|
||||
[ ('a'..'z') ],
|
||||
"Nibble by 1 row"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -197,8 +197,8 @@ $rll = new ReplicaLagLimiter(
|
||||
@lag = (5, 0, 0);
|
||||
is(
|
||||
$rll->wait(),
|
||||
1,
|
||||
"wait() returns 1 despite timeout if continue=yes"
|
||||
0,
|
||||
"wait() returns 0 if timeout and continue=yes"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user