mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
Make CompareResults.t wait for its tables.
This commit is contained in:
@@ -107,7 +107,8 @@ sub get_id {
|
|||||||
# Test the checksum method.
|
# 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(
|
$cr = new CompareResults(
|
||||||
method => 'checksum',
|
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(
|
is_deeply(
|
||||||
$dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'),
|
$dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'),
|
||||||
['dropme'],
|
['dropme'],
|
||||||
@@ -326,9 +312,10 @@ is_deeply(
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|
||||||
my $tmpdir = '/tmp/mk-upgrade-res';
|
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`);
|
$sb->load_file('master', "t/lib/samples/compare-results.sql");
|
||||||
diag(`rm -rf $tmpdir; mkdir $tmpdir`);
|
PerconaTest::wait_for_table($dbh1, "test.t3", "f > 1");
|
||||||
|
|
||||||
$cr = new CompareResults(
|
$cr = new CompareResults(
|
||||||
method => 'rows',
|
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(
|
is_deeply(
|
||||||
$dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'),
|
$dbh1->selectrow_arrayref('SHOW TABLES FROM test LIKE "dropme"'),
|
||||||
['dropme'],
|
['dropme'],
|
||||||
|
Reference in New Issue
Block a user