fix(redis): lock acquisition fails open per spec §9

This commit is contained in:
2026-09-07 12:44:47 +08:00
parent 6adbab44c3
commit 4b40dd669b
2 changed files with 15 additions and 2 deletions
+9
View File
@@ -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()
}