pt-osc generate random table prefix after 10th try

This commit is contained in:
frank-cizmich
2016-02-26 21:03:18 -03:00
parent 805577fcc3
commit 3f90f9ea82
3 changed files with 62 additions and 5 deletions

View File

@@ -38,7 +38,6 @@ my $output;
my $exit_status;
my $sample = "t/pt-online-schema-change/samples/";
# ############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/1336734
# pt-online-schema-change 2.2.17 adds --null-to-not-null feature
@@ -544,6 +543,40 @@ ok ((!$exit_status && $output =~ /success/i) , "--set-vars sql_mode=\\'a\\\\,b\\
$master_dbh->do("drop database test");
$modes->restore_original_modes();
# ############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/1526105
# Not necessarily a bug, but more of an enhancement.
# ############################################################################
# We will run pt-osc more than 10 times using --no-drop-old-table and expect
# no errors.
$sb->load_file('master', "$sample/simple_test_table.sql");
my $errors = 0;
my $successes = 0;
for (1..12) {
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args,
"$master_dsn,D=test,t=test",
"--execute",
"--no-drop-old-table",
"--alter", "ENGINE=InnoDB",
) },
);
if ($exit_status) {
$errors++;
}
if ( $output =~ /Successfully/i ) {
$successes++;
}
}
ok ( (!$errors && $successes == 12), "Issue #1526105 - no-drop-old-table fails after 10 tries" );
$master_dbh->do("DROP DATABASE IF EXISTS test");
# #############################################################################
# Done.
# #############################################################################