PT-2161 - Fix tests for pt-slave-restart (#599)

Added REPLICATION_THREADS=0 to tests which suppose that replication is single-threaded,
because new default in 8.0 is 4 replication threads.
Fixed clean up code in t/pt-slave-restart/pt-slave-restart.t
This commit is contained in:
Sveta Smirnova
2023-02-22 19:02:13 +03:00
committed by GitHub
parent aa1ab5d172
commit 09d9d1a6e4
2 changed files with 6 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ if ( $sandbox_version lt '5.6' ) {
} }
diag('Restarting the sandbox'); diag('Restarting the sandbox');
diag(`SAKILA=0 GTID=1 $trunk/sandbox/test-env restart`); diag(`SAKILA=0 REPLICATION_THREADS=0 GTID=1 $trunk/sandbox/test-env restart`);
diag("Sandbox restarted"); diag("Sandbox restarted");
my $dp = new DSNParser(opts=>$dsn_opts); my $dp = new DSNParser(opts=>$dsn_opts);

View File

@@ -15,6 +15,10 @@ use PerconaTest;
use Sandbox; use Sandbox;
require "$trunk/bin/pt-slave-restart"; require "$trunk/bin/pt-slave-restart";
diag('Restarting the sandbox');
diag(`SAKILA=0 REPLICATION_THREADS=0 GTID=1 $trunk/sandbox/test-env restart`);
diag("Sandbox restarted");
my $dp = new DSNParser(opts=>$dsn_opts); my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master'); my $master_dbh = $sb->get_dbh_for('master');
@@ -137,7 +141,6 @@ is(
# Done. # Done.
# ############################################################################# # #############################################################################
diag(`rm -f /tmp/pt-slave-re*`); diag(`rm -f /tmp/pt-slave-re*`);
$sb->wipe_clean($master_dbh); diag(`$trunk/sandbox/test-env restart`);
$sb->wipe_clean($slave_dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing; done_testing;