Skip to content

Commit

Permalink
fix(test_utils): recover from lock poisoning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Mar 28, 2024
1 parent 1c4b23b commit 4fb493a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) static STORAGE_MUTEX: Mutex<()> = Mutex::new(());

/// Acquires access to storage.
pub(crate) fn acquire_storage() -> MutexGuard<'static, ()> {
STORAGE_MUTEX.lock().unwrap()
STORAGE_MUTEX.lock().unwrap_or_else(|e| e.into_inner())
}

/// Decorates a closure by running it with exclusive access to storage.
Expand Down

0 comments on commit 4fb493a

Please sign in to comment.