From 30242f4928b217dfd75fc4db171ab9d162b85f59 Mon Sep 17 00:00:00 2001 From: Rohan Ranjan Prasad <149056080+rohanranjan0902@users.noreply.github.com> Date: Sat, 19 Sep 2026 14:51:36 +0530 Subject: [PATCH] fix(testing): recover from lock poisoning in memoized! macro (fixes #5841) When a previous test panics while compiling a module, the cache Mutex becomes poisoned. This replaces .unwrap() with .unwrap_or_else() to recover the lock, ensuring subsequent tests surface their actual underlying errors rather than failing with a cascade of generic PoisonErrors. --- crates/testing/src/sdk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/testing/src/sdk.rs b/crates/testing/src/sdk.rs index eb45353aa2b..7bdd5803f67 100644 --- a/crates/testing/src/sdk.rs +++ b/crates/testing/src/sdk.rs @@ -155,7 +155,7 @@ macro_rules! memoized { MEMOIZED .lock() - .unwrap() + .unwrap_or_else(|e| e.into_inner()) .get_or_insert_default() .entry(($($key_tuple,)*)) .or_insert_with_key(|($($key_tuple,)*)| -> $value_ty { $body })