fix(redis): lock acquisition fails open per spec §9
This commit is contained in:
@@ -22,3 +22,12 @@ func TestDisabledIsSafe(t *testing.T) {
|
||||
}
|
||||
un()
|
||||
}
|
||||
|
||||
func TestDeadRedisLockFailsOpen(t *testing.T) {
|
||||
r := New("redis://127.0.0.1:16399") // 死端口
|
||||
un, ok := r.Lock(context.Background(), "lk", time.Second)
|
||||
if !ok {
|
||||
t.Fatal("Lock on redis error must fail open (spec §9)")
|
||||
}
|
||||
un()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user