PT-2295 - Fix tests on distributions

- Found that TIMESTAMP columns in mysql database make last tests in
  t/pt-table-checksum/basics.t unstable, filtering them from the diff.
This commit is contained in:
Sveta Smirnova
2024-02-12 17:12:28 +03:00
parent f136116826
commit 19c740084f

View File

@@ -23,10 +23,6 @@ use Sandbox;
require "$trunk/bin/pt-table-checksum";
# We need to restart, so environment is clean for the
# "Default checksum" test
diag(`$trunk/sandbox/test-env restart`);
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
@@ -81,16 +77,17 @@ sub reset_repl_db {
# from this table after they have been added, so we cannot remove them when wipe cleaning
# sandbox. See https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#static-dynamic-privileges
# This test often fails if run after other tests, we need to see what is wrong
# So we will re-run failed code if test does not pass.
# This test randomly reports diffs for tables with TIMESTAMP columns
# that have ON UPDATE action.
# Therefore we are filtering such tables from the diff
my $cmd = sub { pt_table_checksum::main(@args) };
ok(
no_diff(
$cmd,
"$sample/default-results-$sandbox_version.txt",
sed_out => '\'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d\'',
post_pipe => 'sed \'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d; /mysql.ndb_binlog_index$/d; /mysql.global_grants$/d\' | ' .
sed_out => '\'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d; /mysql.columns_priv$/d; /mysql.engine_cost$/d; /mysql.general_log$/d; /mysql.innodb_index_stats$/d; /mysql.innodb_table_stats$/d; /mysql.password_history$/d; /mysql.procs_priv$/d; /mysql.proxies_priv$/d; /mysql.server_cost$/d; /mysql.slow_log$/d; /mysql.tables_priv$/d\'',
post_pipe => 'sed \'/mysql.plugin$/d; /percona_test.checksums$/d; /mysql.help_category$/d; /mysql.help_keyword$/d; /mysql.help_relation$/d; /mysql.help_topic$/d; /mysql.ndb_binlog_index$/d; /mysql.global_grants$/d; /mysql.columns_priv$/d; /mysql.engine_cost$/d; /mysql.general_log$/d; /mysql.innodb_index_stats$/d; /mysql.innodb_table_stats$/d; /mysql.password_history$/d; /mysql.procs_priv$/d; /mysql.proxies_priv$/d; /mysql.server_cost$/d; /mysql.slow_log$/d; /mysql.tables_priv$/d\' | ' .
'awk \'{print $2 " " $3 " " $4 " " $7 " " $9}\'',
keep_ouput => 1,
),