diff --git a/rs/tests/driver/src/driver/vector_logging_task.rs b/rs/tests/driver/src/driver/vector_logging_task.rs index 6a27c633a4fd..6eece8675fb3 100644 --- a/rs/tests/driver/src/driver/vector_logging_task.rs +++ b/rs/tests/driver/src/driver/vector_logging_task.rs @@ -21,7 +21,19 @@ pub(crate) fn vector_logging_task(group_ctx: GroupContext, start_time: DateTime< } let mut vector_vm = VectorVm::new().with_start_time(start_time); - vector_vm.start(&env).expect("Failed to start Vector VM"); + // This task supervises the whole test plan, so failing (or panicking) here + // would fail the entire test run just because the log-shipping VM could + // not be provisioned. Finishing normally, in contrast, has no effect on + // the supervised tasks. Vector only ships logs to Elasticsearch, so + // continue without it and let the logs be fetched from the nodes directly + // if needed. + if let Err(e) = vector_vm.start(&env) { + warn!( + logger, + "Failed to start Vector VM: {:?}. Continuing the run without vector logging.", e + ); + return; + } loop { if let Err(e) = vector_vm.sync_with_vector(&env) { diff --git a/rs/tests/driver/src/driver/vector_vm.rs b/rs/tests/driver/src/driver/vector_vm.rs index ca02c9ffd659..fb36b22470c1 100644 --- a/rs/tests/driver/src/driver/vector_vm.rs +++ b/rs/tests/driver/src/driver/vector_vm.rs @@ -5,6 +5,7 @@ use std::{ path::Path, }; +use anyhow::Context; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize, Serializer, ser::SerializeStruct}; use slog::{Logger, debug, info, warn}; @@ -265,10 +266,14 @@ impl VectorVm { return Ok(()); }; - let deployed_vm = env.get_deployed_universal_vm("vector").unwrap(); + // Return errors instead of panicking: this runs in the vector_logging + // task which supervises the whole test plan, so a panic here would fail + // the entire test run just because the log-shipping VM is unreachable. + // The caller (the loop in `vector_logging_task`) warns and retries. + let deployed_vm = env.get_deployed_universal_vm("vector")?; let session = deployed_vm .block_on_ssh_session() - .unwrap_or_else(|e| panic!("Failed to setup SSH session to vector because: {e:?}!",)); + .context("Failed to setup SSH session to vector")?; std::fs::write( vector_local_dir.join("generated_config.json"), @@ -309,7 +314,7 @@ docker run -d --name vector \ "#, ), ) - .unwrap(); + .context("Failed to run vector container")?; self.container_running = true; emit_kibana_url_event(&log, &infra_group_name, &self.start_time); @@ -317,7 +322,7 @@ docker run -d --name vector \ info!(log, "Issuing command to reload vector configuration."); deployed_vm .block_on_bash_script_from_session(&session, "docker kill --signal=HUP vector") - .unwrap(); + .context("Failed to reload vector configuration")?; } info!(log, "Vector targets sync complete.");