Skip to content

Commit c58ad74

Browse files
dbussinkpiki
andcommitted
Only report unstable tests and don't fail the build (mysql#84)
* Only report unstable tests and don't fail the build * Show contents of log files after test failures * Add a --flakes option * Start a list of known flaky tests: flaky-tests.txt * Add more flaky tests from mysql#82 * One more flaky test * Fix and check the path to flaky-tests.txt * Ensure --flakes gets a non-empty arg Oddly, `--flakes` is ignored, as is `--flakes=""`, because getopt doesn't call the handler in either of those cases. However: `--flakes ""` will now trigger the `die` added here. The idea here is to catch the error corrected in fe801e631d5a. * Fix path for flaky tests file This fixes the path for the flaky tests, fixes the logic for reading the hash, decreases parallelism further and adds a bunch of tests to the flakes set. * Add flaky tests seen in mysql#80 --------- Co-authored-by: Patrick Reynolds <[email protected]> Signed-off-by: Dirkjan Bussink <[email protected]>
1 parent 3d2e60e commit c58ad74

File tree

3 files changed

+47
-8
lines changed

3 files changed

+47
-8
lines changed

flaky-tests.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
innodb.autoinc_persist_debug
2+
innodb.disable_log_encryption
3+
main.async_client
4+
main.information_schema_stats_expiry_debug
5+
main.join
6+
main.join_cache_bka
7+
main.join_cache_bka_nobnl
8+
main.join_outer
9+
main.join_outer_bka_nobnl
10+
main.join_cache_bnl
11+
main.query_expression
12+
main.sp-threads
13+
perfschema.idx_compare_mems_by_thread_by_event_name
14+
perfschema.idx_compare_threads
15+
rpl.rpl_relay_log_space_limit_deadlock
16+
rpl_gtid.rpl_apply_binlog_with_same_server_id
17+
rpl_gtid.rpl_sync_relay_log_info
18+
sysschema.pr_diagnostics
19+
sysschema.v_io_global_by_file_by_bytes
20+
x.notice_timeout

mysql-test/lib/mtr_report.pm

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,18 @@ sub mtr_report_stats ($$;$) {
572572
$tot_failed++;
573573

574574
if ($::opt_report_unstable_tests and defined $tinfo->{retries}) {
575-
my $num_passed = $tinfo->{retries} - $tinfo->{failures} - 1;
576-
# Tests which exhibit both passing and failing behaviour with
577-
# the same code are unstable tests. The level of instability is
578-
# not restricted i.e. a failed test which is successful on at
579-
# least one retry is marked unstable.
580-
if ($num_passed > 0) {
581-
$tot_unstable++;
582-
$tinfo->{'result'} = 'MTR_RES_UNSTABLE';
575+
if (!%::opt_flakes || $::opt_flakes{$tinfo->{name}}) {
576+
my $num_passed = $tinfo->{retries} - $tinfo->{failures} - 1;
577+
# Tests which exhibit both passing and failing behaviour with
578+
# the same code are unstable tests. The level of instability is
579+
# not restricted i.e. a failed test which is successful on at
580+
# least one retry is marked unstable.
581+
if ($num_passed > 0) {
582+
$tot_unstable++;
583+
$tinfo->{'result'} = 'MTR_RES_UNSTABLE';
584+
}
585+
} else {
586+
print "Unstable test '$tinfo->{name}' not included in --flakes\n";
583587
}
584588
}
585589
} elsif ($tinfo->{'result'} eq 'MTR_RES_SKIPPED') {

mysql-test/mysql-test-run.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
our $opt_no_skip;
219219
our $opt_record;
220220
our $opt_report_unstable_tests;
221+
our %opt_flakes;
221222
our $opt_skip_combinations;
222223
our $opt_suites;
223224
our $opt_suite_opt;
@@ -1030,6 +1031,14 @@ ($$$)
10301031
}
10311032

10321033
mtr_report(" - the logfile can be found in '$logfilepath'\n");
1034+
if (open(my $file, '<', $logfilepath)) {
1035+
print "---[ contents of '$logfilepath' ]---\n";
1036+
while (my $line = <$file>) {
1037+
print $line;
1038+
}
1039+
close($file);
1040+
print "------------------------------------------------------------------------\n";
1041+
}
10331042

10341043
# Move any core files from e.g. mysqltest
10351044
foreach my $coref (glob("core*"), glob("*.dmp")) {
@@ -1759,6 +1768,11 @@ sub command_line_setup {
17591768
'disk-usage!' => \&report_option,
17601769
'enable-disabled' => \&collect_option,
17611770
'fast!' => \$opt_fast,
1771+
'flakes=s' => sub {
1772+
my ($opt, $value) = @_;
1773+
die "--flakes requires an argument" unless $value;
1774+
$opt_flakes{$_} = 1 for (split(' ', $value));
1775+
},
17621776
'force-restart' => \$opt_force_restart,
17631777
'help|h' => \$opt_usage,
17641778
'keep-ndbfs' => \$opt_keep_ndbfs,
@@ -7960,6 +7974,7 @@ ($)
79607974
debug-server Use debug version of server, but without turning on
79617975
tracing.
79627976
debugger=NAME Start mysqld in the selected debugger.
7977+
flakes List of tests allowed to pass by --report-unstable-tests
79637978
gdb Start the mysqld(s) in gdb.
79647979
lldb Start the mysqld(s) in lldb.
79657980
manual-boot-gdb Let user manually start mysqld in gdb, during initialize

0 commit comments

Comments
 (0)