mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Merge pull request #73 from percona/perl-sprintf-warnings-lp1480719
Perl sprintf warnings lp1480719
This commit is contained in:
@@ -1306,8 +1306,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2328,8 +2328,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3967,8 +3967,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6140,9 +6140,15 @@ sub main {
|
|||||||
my $limit = max(@$frames);
|
my $limit = max(@$frames);
|
||||||
|
|
||||||
# 2.00s [ 0.05s, 0.01s, 0.00s ]
|
# 2.00s [ 0.05s, 0.01s, 0.00s ]
|
||||||
my $format = ($hires_ts ? '%.2f' : '%4d') . "s "
|
my $format = ($hires_ts ? '%1$.2f' : '%1$4d') . "s [ ";
|
||||||
. "[ " . join(", ", map { "%5.2fs" } @$frames) . " ]"
|
my $findex = 2;
|
||||||
. ($o->get('print-master-server-id') ? " %d" : '')
|
foreach (@$frames) {
|
||||||
|
$format .= $findex > 2 ? ', ' : '';
|
||||||
|
$format .= '%'.$findex.'$5.2fs';
|
||||||
|
$findex++;
|
||||||
|
}
|
||||||
|
$format .= " ]";
|
||||||
|
$format .= ($o->get('print-master-server-id') ? ' %'.$findex.'$d' : '')
|
||||||
. "\n";
|
. "\n";
|
||||||
|
|
||||||
# ########################################################################
|
# ########################################################################
|
||||||
@@ -6278,10 +6284,12 @@ sub check_delay {
|
|||||||
push @sths, [ $dsn, $sth ];
|
push @sths, [ $dsn, $sth ];
|
||||||
}
|
}
|
||||||
|
|
||||||
my $format_delay = ($args{hires_ts} ? '%.2f' : '%d')
|
my $format_delay = ($args{hires_ts} ? '%1$.2f' : '%1$d')
|
||||||
. ($o->get('print-master-server-id') ? " %d" : "")
|
. ($o->get('print-master-server-id') ? ' %2$d' : "")
|
||||||
|
. "\n";
|
||||||
|
my $format_host = '%1$-20s '.($args{hires_ts} ? '%2$.2f' : '%2$d')
|
||||||
|
. ($o->get('print-master-server-id') ? ' %3$d' : "")
|
||||||
. "\n";
|
. "\n";
|
||||||
my $format_host = "%-20s $format_delay";
|
|
||||||
|
|
||||||
# Before hi-res ts, we could check all slaves at one interval, assuming
|
# Before hi-res ts, we could check all slaves at one interval, assuming
|
||||||
# the checks were fast, i.e. able to be done within one interval. But
|
# the checks were fast, i.e. able to be done within one interval. But
|
||||||
|
@@ -3530,8 +3530,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4918,11 +4918,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -2589,8 +2589,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3591,11 +3591,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
@@ -6124,8 +6123,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2555,8 +2555,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6674,9 +6674,9 @@ sub BUILDARGS {
|
|||||||
report_all => $o->get('report-all'),
|
report_all => $o->get('report-all'),
|
||||||
report_histogram => $o->get('report-histogram'),
|
report_histogram => $o->get('report-histogram'),
|
||||||
},
|
},
|
||||||
num_format => "# %-${label_width}s %3s %7s %7s %7s %7s %7s %7s %7s",
|
num_format => '# %1$-'.$label_width.'s %2$3s %3$7s %4$7s %5$7s %6$7s %7$7s %8$7s %9$7s',
|
||||||
bool_format => "# %-${label_width}s %3d%% yes, %3d%% no",
|
bool_format => '# %1$-'.$label_width.'s %2$3d%% yes, %3$3d%% no',
|
||||||
string_format => "# %-${label_width}s %s",
|
string_format => '# %1$-'.$label_width.'s %2$s',
|
||||||
hidden_attrib => { # Don't sort/print these attribs in the reports.
|
hidden_attrib => { # Don't sort/print these attribs in the reports.
|
||||||
arg => 1, # They're usually handled specially, or not
|
arg => 1, # They're usually handled specially, or not
|
||||||
fingerprint => 1, # printed at all.
|
fingerprint => 1, # printed at all.
|
||||||
@@ -7139,7 +7139,11 @@ sub event_report {
|
|||||||
$val->{checksum},
|
$val->{checksum},
|
||||||
$val->{pos_in_log},
|
$val->{pos_in_log},
|
||||||
);
|
);
|
||||||
$line .= ('_' x (LINE_LENGTH - length($line) + $self->label_width() - 12));
|
my $underscores = LINE_LENGTH - length($line) + $self->label_width() - 12;
|
||||||
|
if ( $underscores < 0 ) {
|
||||||
|
$underscores = 0;
|
||||||
|
}
|
||||||
|
$line .= ('_' x $underscores);
|
||||||
push @result, $line;
|
push @result, $line;
|
||||||
|
|
||||||
if ( $val->{reason} ) {
|
if ( $val->{reason} ) {
|
||||||
@@ -11112,11 +11116,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -2582,8 +2582,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3455,8 +3455,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7930,8 +7930,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8179,11 +8179,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -8093,8 +8093,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2443,6 +2443,7 @@ use Time::Local qw(timegm timelocal);
|
|||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
use B qw();
|
use B qw();
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
require Exporter;
|
require Exporter;
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our %EXPORT_TAGS = ();
|
our %EXPORT_TAGS = ();
|
||||||
@@ -2461,6 +2462,7 @@ our @EXPORT_OK = qw(
|
|||||||
crc32
|
crc32
|
||||||
encode_json
|
encode_json
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
our $mysql_ts = qr/(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)(\.\d+)?/;
|
our $mysql_ts = qr/(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)(\.\d+)?/;
|
||||||
our $proper_ts = qr/(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(\.\d+)?/;
|
our $proper_ts = qr/(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(\.\d+)?/;
|
||||||
@@ -2562,8 +2564,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2592,6 +2594,9 @@ sub parse_timestamp {
|
|||||||
. (defined $f ? '%09.6f' : '%02d'),
|
. (defined $f ? '%09.6f' : '%02d'),
|
||||||
$y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
|
$y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
|
||||||
}
|
}
|
||||||
|
elsif ( $val =~ m/^$proper_ts$/ ) {
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6209,11 +6214,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -2799,8 +2799,8 @@ sub shorten {
|
|||||||
}
|
}
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9123,11 +9123,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -71,11 +71,10 @@ sub new {
|
|||||||
last_reported => $args{start},
|
last_reported => $args{start},
|
||||||
fraction => 0, # How complete the job is
|
fraction => 0, # How complete the job is
|
||||||
callback => sub {
|
callback => sub {
|
||||||
my ($fraction, $elapsed, $remaining, $eta) = @_;
|
my ($fraction, $elapsed, $remaining) = @_;
|
||||||
printf STDERR "$name: %3d%% %s remain\n",
|
printf STDERR "$name: %3d%% %s remain\n",
|
||||||
$fraction * 100,
|
$fraction * 100,
|
||||||
Transformers::secs_to_time($remaining),
|
Transformers::secs_to_time($remaining);
|
||||||
Transformers::ts($eta);
|
|
||||||
},
|
},
|
||||||
%args,
|
%args,
|
||||||
};
|
};
|
||||||
|
@@ -123,9 +123,9 @@ sub BUILDARGS {
|
|||||||
report_all => $o->get('report-all'),
|
report_all => $o->get('report-all'),
|
||||||
report_histogram => $o->get('report-histogram'),
|
report_histogram => $o->get('report-histogram'),
|
||||||
},
|
},
|
||||||
num_format => "# %-${label_width}s %3s %7s %7s %7s %7s %7s %7s %7s",
|
num_format => '# %1$-'.$label_width.'s %2$3s %3$7s %4$7s %5$7s %6$7s %7$7s %8$7s %9$7s',
|
||||||
bool_format => "# %-${label_width}s %3d%% yes, %3d%% no",
|
bool_format => '# %1$-'.$label_width.'s %2$3d%% yes, %3$3d%% no',
|
||||||
string_format => "# %-${label_width}s %s",
|
string_format => '# %1$-'.$label_width.'s %2$s',
|
||||||
hidden_attrib => { # Don't sort/print these attribs in the reports.
|
hidden_attrib => { # Don't sort/print these attribs in the reports.
|
||||||
arg => 1, # They're usually handled specially, or not
|
arg => 1, # They're usually handled specially, or not
|
||||||
fingerprint => 1, # printed at all.
|
fingerprint => 1, # printed at all.
|
||||||
@@ -673,7 +673,11 @@ sub event_report {
|
|||||||
$val->{checksum},
|
$val->{checksum},
|
||||||
$val->{pos_in_log},
|
$val->{pos_in_log},
|
||||||
);
|
);
|
||||||
$line .= ('_' x (LINE_LENGTH - length($line) + $self->label_width() - 12));
|
my $underscores = LINE_LENGTH - length($line) + $self->label_width() - 12;
|
||||||
|
if ( $underscores < 0 ) {
|
||||||
|
$underscores = 0;
|
||||||
|
}
|
||||||
|
$line .= ('_' x $underscores);
|
||||||
push @result, $line;
|
push @result, $line;
|
||||||
|
|
||||||
# Second line: reason why this class is being reported.
|
# Second line: reason why this class is being reported.
|
||||||
|
@@ -159,10 +159,12 @@ sub shorten {
|
|||||||
$num /= $d;
|
$num /= $d;
|
||||||
++$n;
|
++$n;
|
||||||
}
|
}
|
||||||
|
# Added indexes 1$, 2$ to sprintf format to avoid 'redundant' warning
|
||||||
|
# https://bugs.launchpad.net/percona-toolkit/+bug/1480719
|
||||||
return sprintf(
|
return sprintf(
|
||||||
$num =~ m/\./ || $n
|
$num =~ m/\./ || $n
|
||||||
? "%.${p}f%s"
|
? '%1$.'.$p.'f%2$s'
|
||||||
: '%d',
|
: '%1$d',
|
||||||
$num, $units[$n]);
|
$num, $units[$n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ else {
|
|||||||
# Issue 1186: mk-query-digest --processlist --interval --filter ignores interval
|
# Issue 1186: mk-query-digest --processlist --interval --filter ignores interval
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
my $output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 2>&1`;
|
my $output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval 0.5 2>&1`;
|
||||||
|
|
||||||
my @times = $output =~ m/Current time: \S+/g;
|
my @times = $output =~ m/Current time: \S+/g;
|
||||||
ok(
|
ok(
|
||||||
@@ -38,7 +38,7 @@ ok(
|
|||||||
"--interval limits number of processlist polls (issue 1186)"
|
"--interval limits number of processlist polls (issue 1186)"
|
||||||
);
|
);
|
||||||
|
|
||||||
$output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval .5 --filter '(\$event->{arg} =~ /NEVER HAPPEN/)' 2>&1`;
|
$output = `PTDEBUG=1 $trunk/bin/pt-query-digest --processlist h=127.1,P=12345,u=msandbox,p=msandbox --run-time 2 --port 12345 --interval 0.5 --filter '(\$event->{arg} =~ /NEVER HAPPEN/)' 2>&1`;
|
||||||
|
|
||||||
@times = $output =~ m/Current time: \S+/g;
|
@times = $output =~ m/Current time: \S+/g;
|
||||||
ok(
|
ok(
|
||||||
|
@@ -46,7 +46,7 @@ my $r = $slave_dbh->selectrow_hashref('show slave status');
|
|||||||
like($r->{last_error}, qr/Table 'test.t' doesn't exist'/, 'It is busted');
|
like($r->{last_error}, qr/Table 'test.t' doesn't exist'/, 'It is busted');
|
||||||
|
|
||||||
# Start an instance
|
# Start an instance
|
||||||
diag(`$trunk/bin/pt-slave-restart --max-sleep .25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --daemonize --pid /tmp/pt-slave-restart.pid --log /tmp/pt-slave-restart.log`);
|
diag(`$trunk/bin/pt-slave-restart --max-sleep 0.25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --daemonize --pid /tmp/pt-slave-restart.pid --log /tmp/pt-slave-restart.log`);
|
||||||
my $output = `ps x | grep 'pt-slave-restart \-\-max\-sleep ' | grep -v grep | grep -v pt-slave-restart.t`;
|
my $output = `ps x | grep 'pt-slave-restart \-\-max\-sleep ' | grep -v grep | grep -v pt-slave-restart.t`;
|
||||||
like($output, qr/pt-slave-restart --max/, 'It lives');
|
like($output, qr/pt-slave-restart --max/, 'It lives');
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ like(
|
|||||||
);
|
);
|
||||||
|
|
||||||
# Start an instance
|
# Start an instance
|
||||||
$output = `$trunk/bin/pt-slave-restart --max-sleep .25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --error-text "doesn't exist" --run-time 1s 2>&1`;
|
$output = `$trunk/bin/pt-slave-restart --max-sleep 0.25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --error-text "doesn't exist" --run-time 1s 2>&1`;
|
||||||
unlike(
|
unlike(
|
||||||
$output,
|
$output,
|
||||||
qr/Error does not match/,
|
qr/Error does not match/,
|
||||||
@@ -104,7 +104,7 @@ unlike(
|
|||||||
# Issue 391: Add --pid option to all scripts
|
# Issue 391: Add --pid option to all scripts
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
`touch /tmp/pt-script.pid`;
|
`touch /tmp/pt-script.pid`;
|
||||||
$output = `$trunk/bin/pt-slave-restart --max-sleep .25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --pid /tmp/pt-script.pid 2>&1`;
|
$output = `$trunk/bin/pt-slave-restart --max-sleep 0.25 -h 127.0.0.1 -P 12346 -u msandbox -p msandbox --pid /tmp/pt-script.pid 2>&1`;
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
qr{PID file /tmp/pt-script.pid already exists},
|
qr{PID file /tmp/pt-script.pid already exists},
|
||||||
|
@@ -357,7 +357,7 @@ like(
|
|||||||
$output = output(
|
$output = output(
|
||||||
sub { $exit_status = pt_table_checksum::main(
|
sub { $exit_status = pt_table_checksum::main(
|
||||||
qw(--user msandbox --pass msandbox),
|
qw(--user msandbox --pass msandbox),
|
||||||
qw(-S /tmp/12345/mysql_sandbox12345.sock --set-vars innodb_lock_wait_timeout=3 --run-time 5)) },
|
qw(-S /tmp/12345/mysql_sandbox12345.sock --set-vars innodb_lock_wait_timeout=3 --run-time 8)) },
|
||||||
stderr => 1,
|
stderr => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ $exit_status = pt_table_checksum::main(@args,
|
|||||||
my $t = time - $t0;
|
my $t = time - $t0;
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
$t >= 1.0 && $t <= 2.5 + $ENV{'PERCONA_SLOW_BOX'}*3,
|
$t >= 1.0 && $t <= ($ENV{PERCONA_SLOW_BOX} ? 5.5 : 2.5),
|
||||||
"Ran 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");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user