From 58989b7ef9192486be09c0ce4bb09459a1b7faae Mon Sep 17 00:00:00 2001 From: georgehao Date: Tue, 4 Feb 2025 15:53:52 +0800 Subject: [PATCH] add panic log --- internal/syncx/mutex_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/syncx/mutex_test.go b/internal/syncx/mutex_test.go index f56c94ce73..10a9a75d77 100644 --- a/internal/syncx/mutex_test.go +++ b/internal/syncx/mutex_test.go @@ -32,7 +32,9 @@ func TestClosableMutex_MustLock(t *testing.T) { cm := NewClosableMutex() cm.MustLock() defer func() { - if r := recover(); r == nil { + if r := recover(); r != nil { + t.Log("panic detected:", r) // Log the panic message + } else { t.Fatal("expected MustLock to panic when already locked") } }()