diff --git a/rs/canister_sandbox/src/replica_controller/allowed_panics.rs b/rs/canister_sandbox/src/replica_controller/allowed_panics.rs index 31f62c3dbb3f..6a19d8703d7a 100644 --- a/rs/canister_sandbox/src/replica_controller/allowed_panics.rs +++ b/rs/canister_sandbox/src/replica_controller/allowed_panics.rs @@ -1,5 +1,9 @@ //! This module contains panics that are allowed by default to occur in logs in system-tests. +pub(crate) fn panic_sandboxed_execution_controller_reply_channel_closed() -> ! { + panic!("Sandboxed_execution_controller reply channel closed unexpectedly") +} + pub(crate) fn panic_launcher_exited_due_to_signal(pid: u32) -> ! { panic!( "Error from launcher process, pid {pid} exited due to signal! In test environments (e.g., PocketIC), you can safely ignore this message." diff --git a/rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs b/rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs index f178b3053018..f3f9dc47a5d1 100644 --- a/rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs +++ b/rs/canister_sandbox/src/replica_controller/sandboxed_execution_controller.rs @@ -1,3 +1,4 @@ +use super::allowed_panics::panic_sandboxed_execution_controller_reply_channel_closed; use crate::compiler_sandbox::WasmCompilerProxy; use crate::controller_launcher_service::ControllerLauncherService; use crate::launcher_service::LauncherService; @@ -1028,7 +1029,7 @@ impl WasmExecutor for SandboxedExecutionController { // Wait for completion. let result = rx .recv() - .expect("Sandboxed_execution_controller reply channel closed unexpectedly"); + .unwrap_or_else(|_| panic_sandboxed_execution_controller_reply_channel_closed()); drop(wait_timer); let _finish_timer = self .metrics