Commit 77b4ce5b authored by unknown's avatar unknown

Only run the "saved core limit" if the datadir was saved

parent 3b4ba47d
...@@ -404,32 +404,32 @@ sub run_test_server { ...@@ -404,32 +404,32 @@ sub run_test_server {
else { else {
mtr_report(" - saving '$worker_savedir/' to '$savedir/'"); mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
rename($worker_savedir, $savedir); rename($worker_savedir, $savedir);
}
$num_saved_datadir++;
if ($opt_max_save_core > 0) { if ($opt_max_save_core > 0) {
# Limit number of core files saved # Limit number of core files saved
find({ no_chdir => 1, find({ no_chdir => 1,
wanted => sub { wanted => sub {
my $core_file= $File::Find::name; my $core_file= $File::Find::name;
my $core_name= basename($core_file); my $core_name= basename($core_file);
if ($core_name =~ "core*"){ if ($core_name =~ "core*"){
if ($num_saved_cores >= $opt_max_save_core) { if ($num_saved_cores >= $opt_max_save_core) {
mtr_report(" - deleting '$core_name'", mtr_report(" - deleting '$core_name'",
"($num_saved_cores/$opt_max_save_core)"); "($num_saved_cores/$opt_max_save_core)");
unlink("$core_file"); unlink("$core_file");
} }
else { else {
mtr_report(" - found '$core_name'", mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)"); "($num_saved_cores/$opt_max_save_core)");
}
++$num_saved_cores;
} }
++$num_saved_cores;
} }
} },
}, $savedir);
$savedir); }
} }
$num_saved_datadir++;
if ( !$opt_force ) { if ( !$opt_force ) {
# Test has failed, force is off # Test has failed, force is off
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment