fix: errorous deadlock report in unittests (#41350)

See #41349

Signed-off-by: Ted Xu <ted.xu@zilliz.com>
pull/41379/head
Ted Xu 2025-04-17 13:16:31 +08:00 committed by GitHub
parent 52c7d62012
commit 93788255eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -18,12 +18,14 @@
package lock
import (
"github.com/sasha-s/go-deadlock"
)
import "sync"
// The file originally used "github.com/sasha-s/go-deadlock" as deadlock detection tool in unit tests.
// However, it is broken since go 1.23, as reported in https://github.com/sasha-s/go-deadlock/issues/35.
// To restore deadlock detection, make sure the bug is fixed in go-deadlock, and use "go-deadlock" package instead.
// use `deadlock.Mutex` for test build
type Mutex = deadlock.Mutex
type Mutex = sync.Mutex
// use `deadlock.RWMutex` for test build
type RWMutex = deadlock.RWMutex
type RWMutex = sync.RWMutex