mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Test and fix bug 1206728.
This commit is contained in:
@@ -4448,15 +4448,12 @@ sub main {
|
||||
my $dp = $o->DSNParser();
|
||||
$dp->prop('set-vars', $o->set_vars());
|
||||
|
||||
my $src;
|
||||
if ( my $src_dsn_string = shift @ARGV ) {
|
||||
$src = Cxn->new(
|
||||
dsn_string => $src_dsn_string,
|
||||
parent => $o->get('daemonize'),
|
||||
DSNParser => $dp,
|
||||
OptionParser => $o,
|
||||
);
|
||||
}
|
||||
my $src = Cxn->new(
|
||||
dsn_string => shift @ARGV,
|
||||
parent => $o->get('daemonize'),
|
||||
DSNParser => $dp,
|
||||
OptionParser => $o,
|
||||
);
|
||||
|
||||
my $dst;
|
||||
if ( my $dst_dsn = $o->get('dest') ) {
|
||||
|
@@ -136,8 +136,25 @@ is_deeply(
|
||||
"Bug 1195034: TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH"
|
||||
) or diag(Dumper($deadlocks));
|
||||
|
||||
# #############################################################################
|
||||
# pt-deadlock-logger 2.2 requires a DSN
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1206728
|
||||
# #############################################################################
|
||||
|
||||
my $config = "/tmp/pt-deadlock-logger-test.conf.$PID";
|
||||
`cp $trunk/t/pt-deadlock-logger/samples/pt-deadlock-logger-test.conf $config`;
|
||||
|
||||
my $output = `$trunk/bin/pt-deadlock-logger --config $config --iteration 1 2>&1`;
|
||||
|
||||
is(
|
||||
$CHILD_ERROR,
|
||||
0,
|
||||
"Does not require explicit DSN (bug 1206728)"
|
||||
) or diag($output);
|
||||
|
||||
diag(`rm -rf $config`);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
done_testing;
|
||||
exit;
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 4;
|
||||
use Test::More;
|
||||
|
||||
use PerconaTest;
|
||||
|
||||
@@ -18,12 +18,14 @@ my $output;
|
||||
# #############################################################################
|
||||
# Sanity tests.
|
||||
# #############################################################################
|
||||
$output = `$trunk/bin/pt-deadlock-logger --dest D=test,t=deadlocks 2>&1`;
|
||||
like(
|
||||
$output,
|
||||
qr/No DSN was specified/,
|
||||
'Requires source host'
|
||||
);
|
||||
|
||||
# Wrong design: https://bugs.launchpad.net/percona-toolkit/+bug/1206728
|
||||
#$output = `$trunk/bin/pt-deadlock-logger --dest D=test,t=deadlocks 2>&1`;
|
||||
#like(
|
||||
# $output,
|
||||
# qr/No DSN was specified/,
|
||||
# 'Requires source host'
|
||||
#);
|
||||
|
||||
$output = `$trunk/bin/pt-deadlock-logger h=127.1 --dest t=deadlocks 2>&1`;
|
||||
like(
|
||||
@@ -55,4 +57,4 @@ is(
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
exit;
|
||||
done_testing;
|
||||
|
@@ -0,0 +1,4 @@
|
||||
h=127.1
|
||||
P=12345
|
||||
u=msandbox
|
||||
p=msandbox
|
Reference in New Issue
Block a user