diff --git a/t/lib/CompareResults.t b/t/lib/CompareResults.t index 09906f05..b92706d6 100644 --- a/t/lib/CompareResults.t +++ b/t/lib/CompareResults.t @@ -107,7 +107,8 @@ sub get_id { # Test the checksum method. # ############################################################################# -diag(`/tmp/12345/use < $trunk/t/lib/samples/compare-results.sql`); +$sb->load_file('master', "t/lib/samples/compare-results.sql"); +PerconaTest::wait_for_table($dbh1, "test.t3", "f > 1"); $cr = new CompareResults( method => 'checksum', @@ -132,21 +133,6 @@ isa_ok($cr, 'CompareResults'); }, ); -$i = 0; -PerconaTest::wait_until( - sub { - my $r; - eval { - $r = $dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'); - }; - return 1 if ($r->[0] || '') eq 'dropme'; - diag('Waiting for CREATE TABLE...') unless $i++; - return 0; - }, - 0.5, - 30, -); - is_deeply( $dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'), ['dropme'], @@ -326,9 +312,10 @@ is_deeply( # ############################################################################# my $tmpdir = '/tmp/mk-upgrade-res'; +diag(`rm -rf $tmpdir 2>/dev/null; mkdir $tmpdir`); -diag(`/tmp/12345/use < $trunk/t/lib/samples/compare-results.sql`); -diag(`rm -rf $tmpdir; mkdir $tmpdir`); +$sb->load_file('master', "t/lib/samples/compare-results.sql"); +PerconaTest::wait_for_table($dbh1, "test.t3", "f > 1"); $cr = new CompareResults( method => 'rows', @@ -351,21 +338,6 @@ isa_ok($cr, 'CompareResults'); }, ); -$i = 0; -PerconaTest::wait_until( - sub { - my $r; - eval { - $r = $dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'); - }; - return 1 if ($r->[0] || '') eq 'dropme'; - diag('Waiting for CREATE TABLE...') unless $i++; - return 0; - }, - 0.5, - 30, -); - is_deeply( $dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'), ['dropme'],