mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 14:18:32 +00:00
Fixed flaky tests
The tests previously tested assertions against the replica after executing changes in the source without waiting for the replication to converge.
This commit is contained in:
@@ -37,13 +37,7 @@ $sb->create_dbs($source_dbh, ['test']);
|
|||||||
$sb->load_file('source', "t/lib/samples/char-chunking/ascii.sql", "test");
|
$sb->load_file('source', "t/lib/samples/char-chunking/ascii.sql", "test");
|
||||||
$source_dbh->do('alter table test.ascii drop column `i`');
|
$source_dbh->do('alter table test.ascii drop column `i`');
|
||||||
|
|
||||||
wait_until(
|
$sb->wait_for_replicas();
|
||||||
sub {
|
|
||||||
my $row;
|
|
||||||
eval {$row = $replica_dbh->selectall_arrayref("select * from test.ascii");};
|
|
||||||
return 1 if $row && @$row > 100;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
$replica_dbh->do('delete from test.ascii where c like "Zesus%"');
|
$replica_dbh->do('delete from test.ascii where c like "Zesus%"');
|
||||||
|
|
||||||
|
@@ -40,6 +40,8 @@ $sb->wipe_clean($replica_dbh);
|
|||||||
$sb->create_dbs($source_dbh, [qw(issue218)]);
|
$sb->create_dbs($source_dbh, [qw(issue218)]);
|
||||||
$sb->use('source', '-e "CREATE TABLE issue218.t1 (i INT)"');
|
$sb->use('source', '-e "CREATE TABLE issue218.t1 (i INT)"');
|
||||||
$sb->use('source', '-e "INSERT INTO issue218.t1 VALUES (NULL)"');
|
$sb->use('source', '-e "INSERT INTO issue218.t1 VALUES (NULL)"');
|
||||||
|
$sb->wait_for_replicas();
|
||||||
|
|
||||||
qx($trunk/bin/pt-table-sync --no-check-replica --print --database issue218 h=127.1,P=12345,u=msandbox,p=msandbox P=12346);
|
qx($trunk/bin/pt-table-sync --no-check-replica --print --database issue218 h=127.1,P=12345,u=msandbox,p=msandbox P=12346);
|
||||||
ok(!$?, 'Issue 218: NULL values compare as equal');
|
ok(!$?, 'Issue 218: NULL values compare as equal');
|
||||||
|
|
||||||
|
@@ -74,6 +74,8 @@ like(
|
|||||||
"PT-1256 Set the correct charset"
|
"PT-1256 Set the correct charset"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$sb->wait_for_replicas();
|
||||||
|
|
||||||
SKIP: {
|
SKIP: {
|
||||||
my $vp = VersionParser->new($source_dbh);
|
my $vp = VersionParser->new($source_dbh);
|
||||||
if ($vp->cmp('8.0') > -1 && $vp->cmp('8.0.14') < 0 && $vp->flavor() !~ m/maria/i) {
|
if ($vp->cmp('8.0') > -1 && $vp->cmp('8.0.14') < 0 && $vp->flavor() !~ m/maria/i) {
|
||||||
@@ -92,6 +94,8 @@ SKIP: {
|
|||||||
$output = `/tmp/12345/use -e 'show create table test.t2'`;
|
$output = `/tmp/12345/use -e 'show create table test.t2'`;
|
||||||
like($output, qr/COMMENT='test1'/, '--lock-and-rename worked');
|
like($output, qr/COMMENT='test1'/, '--lock-and-rename worked');
|
||||||
|
|
||||||
|
$sb->wait_for_replicas();
|
||||||
|
|
||||||
#4
|
#4
|
||||||
$row = $replica1_dbh->selectrow_hashref("SELECT f2 FROM test.t2 WHERE id = 1");
|
$row = $replica1_dbh->selectrow_hashref("SELECT f2 FROM test.t2 WHERE id = 1");
|
||||||
is(
|
is(
|
||||||
|
Reference in New Issue
Block a user