From 5d8b2956a07ed409bcaed79ef0a39b531308d11f Mon Sep 17 00:00:00 2001 From: "Brian Fraser fraserb@gmail.com" <> Date: Tue, 5 Jun 2012 15:36:05 -0300 Subject: [PATCH] t/pt-table-sync/triggers.t: Use wait_for_table and wait for both tables to replicate --- t/pt-table-sync/triggers.t | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/t/pt-table-sync/triggers.t b/t/pt-table-sync/triggers.t index e3750eeb..5025dd68 100644 --- a/t/pt-table-sync/triggers.t +++ b/t/pt-table-sync/triggers.t @@ -97,20 +97,11 @@ like( # ############################################################################# $sb->load_file('master', 't/pt-table-sync/samples/issue_367.sql'); -my $i = 0; -PerconaTest::wait_until( - sub { - my $r; - eval { - $r = $slave_dbh->selectrow_arrayref('SHOW TABLES FROM db1'); - }; - return 1 if ($r->[0] || '') eq 't1'; - diag('Waiting for slave...') unless $i++; - return 0; - }, - 0.5, - 30, -); +PerconaTest::wait_for_table( + $slave_dbh, + "$_.t1", + "id > 4" +) for qw( db1 db2 ); # Make slave db1.t1 and db2.t1 differ from master. $slave_dbh->do('INSERT INTO db1.t1 VALUES (9)');