diff --git a/t/pt-table-checksum/pt-193.t b/t/pt-table-checksum/pt-193.t index 7f3af8d6..34bca666 100644 --- a/t/pt-table-checksum/pt-193.t +++ b/t/pt-table-checksum/pt-193.t @@ -27,6 +27,13 @@ else { plan tests => 3; } +# This table is being used by some other tests and it is not being properly cleaned +# so this tests fails sometimes. Just in case, clean the table but don't fail if the +# table doesn't exists. +eval { + $dbh->do("TRUNCATE TABLE percona_test.load_data"); +}; + $sb->load_file('master', 't/lib/samples/issue_pt-193_backtick_in_col_comments.sql'); # The sandbox servers run with lock_wait_timeout=3 and it's not dynamic @@ -49,7 +56,7 @@ is( $exit_status, 0, "PT-193 use single backtick in comments", -); +) or diag($output); like( $output, diff --git a/t/pt-table-sync/pt-1256.t b/t/pt-table-sync/pt-1256.t index daa83ac9..3bfb652c 100644 --- a/t/pt-table-sync/pt-1256.t +++ b/t/pt-table-sync/pt-1256.t @@ -6,6 +6,9 @@ BEGIN { unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; }; +binmode(STDIN, ':utf8') or die "Can't binmode(STDIN, ':utf8'): $OS_ERROR"; +binmode(STDOUT, ':utf8') or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR"; + use strict; use utf8; use Encode qw(decode encode); @@ -17,9 +20,6 @@ use PerconaTest; use Sandbox; require "$trunk/bin/pt-table-sync"; -binmode(STDIN, ':utf8') or die "Can't binmode(STDIN, ':utf8'): $OS_ERROR"; -binmode(STDOUT, ':utf8') or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR"; - my $dp = new DSNParser(opts=>$dsn_opts); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $master_dbh = $sb->get_dbh_for('master'); @@ -39,9 +39,10 @@ else { plan tests => 5; } + my ($output, $status); my @args = ('--sync-to-master', 'h=127.1,P=12346,u=msandbox,p=msandbox', - qw(-t test.t1 --print --execute)); + qw(-t test.t1 --print --execute --charset utf8)); # use lib/samples dir since the main change is in DSNParser $sb->load_file('master', "t/lib/samples/charset.sql"); @@ -77,10 +78,10 @@ is( $row->{f2}, $want, "Character set is correct", -) or diag("Want '$want', got '$row->{f2}"); +) or diag("Want '".($want||"")."', got '".($row->{f2}||"")."'"); SKIP: { - skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself", 1 if ($sandbox_version ge '8.0'); + skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself", 2 if ($sandbox_version ge '8.0'); # 3 $output = `$trunk/bin/pt-table-sync --execute --lock-and-rename h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=t1 t=t2 2>&1`; $output = `/tmp/12345/use -e 'show create table test.t2'`;