From 3a17d1d6fd4b44f9438eb457423a72b3eddb98ce Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Sun, 3 Mar 2013 08:41:41 -0700 Subject: [PATCH] Skip t/pt-archiver/check_slave_lag.t on MySQL 5.6 because the trick doesn't work. --- t/pt-archiver/check_slave_lag.t | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/t/pt-archiver/check_slave_lag.t b/t/pt-archiver/check_slave_lag.t index 4275d512..71432a55 100644 --- a/t/pt-archiver/check_slave_lag.t +++ b/t/pt-archiver/check_slave_lag.t @@ -29,13 +29,10 @@ elsif ( !$dbh2 ) { elsif ( $sb->is_cluster_mode ) { plan skip_all => 'Not for PXC', } -else { - plan tests => 7; +elsif ( $sandbox_version ge '5.6' ) { + plan skip_all => 'Slave trick does not work on MySQL 5.6+'; } -$sb->wipe_clean($dbh); -$sb->wipe_clean($dbh2); - my $output; my $sql; my $cnf = "/tmp/12345/my.sandbox.cnf"; @@ -44,6 +41,7 @@ my $cmd = "$trunk/bin/pt-archiver"; # ############################################################################# # Issue 758: Make mk-archiver wait for a slave # ############################################################################# + $sb->load_file('master', 't/pt-archiver/samples/issue_758.sql'); is_deeply( @@ -52,11 +50,9 @@ is_deeply( 'Table not purged yet (issue 758)' ); -# TODO: MySQL 5.6 is no longer tricked by this method. - # Once this goes through repl, the slave will sleep causing # seconds behind master to increase > 0. -system('/tmp/12345/use -e "insert into issue_758.t select sleep(2)"'); +system('/tmp/12345/use -e "insert into issue_758.t select sleep(3)"'); # Slave seems to be lagging now so the first row should get purged # immediately, then the script should wait about 2 seconds until @@ -70,14 +66,11 @@ is_deeply( 'No changes on slave yet (issue 758)' ); -TODO: { - local $::TODO = "Timing-related test, may fail"; - is_deeply( - $dbh->selectall_arrayref('select * from issue_758.t'), - [[0],[2]], - 'First row purged (issue 758)' - ); -} +is_deeply( + $dbh->selectall_arrayref('select * from issue_758.t'), + [[0],[2]], + 'First row purged (issue 758)' +); # The script it waiting for slave lag so no more rows should be purged yet. sleep 1; @@ -106,6 +99,5 @@ is_deeply( # Done. # ############################################################################# $sb->wipe_clean($dbh); -$sb->wipe_clean($dbh2); ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); -exit; +done_testing;