Skip to content

Commit

Permalink
Don't abort during RCC-specific setup in case of a failure
Browse files Browse the repository at this point in the history
We only want to abort and terminate in case we received a corresponding
signal. Otherwise, we drop the affected suites, log the error and
continue.
  • Loading branch information
jherbel committed Nov 8, 2023
1 parent 20a969a commit 158ffd3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions v2/robotmk/src/bin/scheduler/setup/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::icacls::run_icacls_command;
use crate::command_spec::CommandSpec;
use crate::environment::Environment;
use crate::internal_config::{sort_suites_by_name, GlobalConfig, Suite};
use crate::logging::log_and_return_error;
use crate::results::RCCSetupFailures;
use crate::sessions::session::{CurrentSession, RunOutcome, RunSpec, Session};

Expand Down Expand Up @@ -218,10 +219,17 @@ fn run_command_spec_per_session(
}

fn run_command_spec_in_session(session: &Session, run_spec: &RunSpec) -> Result<bool> {
match session.run(run_spec).context(format!(
let run_outcome = match session.run(run_spec).context(format!(
"Failed to run {} for `{session}`",
run_spec.command_spec
))? {
)) {
Ok(run_outcome) => run_outcome,
Err(error) => {
log_and_return_error(error);
return Ok(false);
}
};
match run_outcome {
RunOutcome::Exited(exit_code) => match exit_code {
Some(exit_code) => {
if exit_code == 0 {
Expand Down

0 comments on commit 158ffd3

Please sign in to comment.