Commit 63f12c9f authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Handle user abort in EE more gracefully

Log it as an error but do not report it as such to certain callbacks thus
allowing to still save a replay configuration after an abort.
parent aaa8bf8f
......@@ -404,7 +404,7 @@ sub sanitize_config {
if (!defined($run_ref) || $$run_ref == 0) {
$logger->debug("Returning early (before receiving READY message) due to unset run.");
return "Aborted";
return {'aborted' => 1};
}
if (defined($tot_timeout) && ($tot_timeout <= 0)) {
......
......@@ -587,9 +587,12 @@ sub _check_halt ($) {
my $reasons = [];
my $fiji_tests = $self->{'fiji_tests'};
# NB: HALT_on_xxx information is defined in tests config file but
# is not setable by any UI. If need be it can be hardcoded in the .ini
# NB: The HALT_ON_xxx_ERROR values are defined in test config files but
# are not settable in any UI. If need be it can be hardcoded in the .tst
if ($recv_msg->{'aborted'}) {
return ["an active abort"];
}
if ($recv_msg->{'msg_type'} eq "UNDERRUN") {
$logger->info("UNDERRUN message received. HALT_ON_UNDERRUN = " . $fiji_tests->{'design'}->{'HALT_ON_UNDERRUN'} . ".");
push @{$reasons}, 'HALT_ON_UNDERRUN' if $fiji_tests->{'design'}->{'HALT_ON_UNDERRUN'};
......
......@@ -257,7 +257,7 @@ sub _download {
# process message
if (defined $downloader_reply && ref $downloader_reply eq "HASH") {
$self->_update_rmsg_status($downloader_reply);
$self->_update_rmsg_status($downloader_reply) if not $downloader_reply->{'aborted'};
} else {
$self->{'msg_type'}->configure(-text => $downloader_reply, -bg => "red");
}
......@@ -278,20 +278,22 @@ sub _download {
) if (($cfg->{'mode'} ne 'dryrun') && ($cfg->{'mode'} ne 'manual'));
# if a valid return message has beeen received from the FIC
if (defined $downloader_reply && ref $downloader_reply eq "HASH") {
my $rmsg_error_strings = RMSG_ERROR_STRINGS;
# if errors were reported, display error messages accordingly
if ($downloader_reply->{'error'}->{'ANY'}) {
my $text = "FIJI Hardware reported error(s):\n";
for my $k (keys(%{$rmsg_error_strings})) {
$text .= RMSG_ERROR_STRINGS->{$k} . "\n" if $downloader_reply->{'error'}->{$k};
}
if (defined $downloader_reply && ref $downloader_reply eq "HASH" ) {
if (not $downloader_reply->{'aborted'}) {
my $rmsg_error_strings = RMSG_ERROR_STRINGS;
# if errors were reported, display error messages accordingly
if ($downloader_reply->{'error'}->{'ANY'}) {
my $text = "FIJI Hardware reported error(s):\n";
for my $k (keys(%{$rmsg_error_strings})) {
$text .= RMSG_ERROR_STRINGS->{$k} . "\n" if $downloader_reply->{'error'}->{$k};
}
my $d = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-text => $text,
-title => "Error while downloading.",);
my $d = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-text => $text,
-title => "Error while downloading.",);
$d->Show();
$d->Show();
}
}
# if the message contained a valid reference to executed tests
if (defined $worker_msg->{'testref'} && blessed($worker_msg->{'testref'}) && $worker_msg->{'testref'}->isa("FIJI::Tests")) {
......@@ -300,7 +302,9 @@ sub _download {
$self->{'test_callback'}->(1);
} else {
$self->{'last_test'} = undef;
$self->{'test_callback'}->(0);
# In case we got actively aborted do not report an error to the callback
my $state = $downloader_reply->{'aborted'} ? 1 : 0;
$self->{'test_callback'}->($state);
}
} else {
$self->{'last_test'} = undef;
......
Supports Markdown
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