MDEV-30186: mtr: Use of uninitialized value $test_name in substitution

There is an assumption that when there are are no completed tests,
that means they are still running and then an attempt is made to
identify these tests as stalled.

The other possibility is however there are no tests that where run.

Test this early and then exit quickly and no later misunderstandings
need to be made.
This commit is contained in:
Daniel Black 2023-04-20 10:13:12 +10:00
parent f7791cc7cb
commit c21bc17a51

View file

@ -401,6 +401,11 @@ sub main {
mtr_report("Collecting tests..."); mtr_report("Collecting tests...");
my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list);
if (@$tests == 0) {
mtr_report("No tests to run...");
exit 0;
}
mark_time_used('collect'); mark_time_used('collect');
mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern(); mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern();