mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-27 07:54:58 +00:00
Fix and make tests more reliable.
This commit is contained in:
@@ -52,18 +52,20 @@ $master_dbh->do('create table t (i int, unique index (i))');
|
||||
$master_dbh->do('insert into t values (1),(2)');
|
||||
|
||||
$slave_dbh->do('insert into t values (3)');
|
||||
PerconaTest::wait_for_table($slave_dbh, 'test.t', 'i=1');
|
||||
|
||||
is_deeply(
|
||||
$master_dbh->selectall_arrayref('select * from test.t'),
|
||||
$master_dbh->selectall_arrayref('select * from test.t order by i'),
|
||||
[[1],[2]],
|
||||
'Data on master before sync'
|
||||
);
|
||||
|
||||
use Data::Dumper;
|
||||
my $rows = $slave_dbh->selectall_arrayref('select * from test.t order by i');
|
||||
is_deeply(
|
||||
$slave_dbh->selectall_arrayref('select * from test.t'),
|
||||
$rows,
|
||||
[[1],[2],[3]],
|
||||
'Data on slave before sync'
|
||||
);
|
||||
) or print Dumper($rows);
|
||||
|
||||
$master_dbh->do('SET GLOBAL binlog_format="ROW"');
|
||||
$master_dbh->disconnect();
|
||||
|
@@ -51,12 +51,12 @@ output(
|
||||
|
||||
my $binlog = $master_dbh->selectrow_arrayref('show master logs');
|
||||
|
||||
$output = `$mysqlbinlog /tmp/12345/data/$binlog->[0] | grep maatkit`;
|
||||
$output = `$mysqlbinlog /tmp/12345/data/$binlog->[0] | grep 'percona-toolkit'`;
|
||||
$output =~ s/pid:\d+/pid:0/ if $output;
|
||||
$output =~ s/host:\S+?\*/host:-*/ if $output;
|
||||
is(
|
||||
$output,
|
||||
"DELETE FROM `onlythisdb`.`t` WHERE `i`='5' LIMIT 1 /*maatkit src_db:onlythisdb src_tbl:t src_dsn:P=12345,h=127.0.0.1,p=...,u=msandbox dst_db:onlythisdb dst_tbl:t dst_dsn:P=12346,h=127.0.0.1,p=...,u=msandbox lock:1 transaction:0 changing_src:1 replicate:0 bidirectional:0 pid:0 user:$ENV{USER} host:-*/
|
||||
"DELETE FROM `onlythisdb`.`t` WHERE `i`='5' LIMIT 1 /*percona-toolkit src_db:onlythisdb src_tbl:t src_dsn:P=12345,h=127.0.0.1,p=...,u=msandbox dst_db:onlythisdb dst_tbl:t dst_dsn:P=12346,h=127.0.0.1,p=...,u=msandbox lock:1 transaction:0 changing_src:1 replicate:0 bidirectional:0 pid:0 user:$ENV{USER} host:-*/
|
||||
",
|
||||
"Trace message appended to change SQL"
|
||||
);
|
||||
|
Reference in New Issue
Block a user