MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestLocker_WaitLock_Failure

Function TestLocker_WaitLock_Failure

internal/lock/lock_test.go:125–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

123}
124
125func TestLocker_WaitLock_Failure(t *testing.T) {
126 db, mock := redismock.NewClientMock()
127 locker := NewLocker(db, "test-key", "test-value")
128
129 err := locker.WaitLock(context.Background(), 5*time.Second, time.Nanosecond)
130 assert.ErrorIs(t, err, ErrLockWaitTimeout)
131 assert.EqualError(t, err, "failed to acquire lock for key test-key within the wait timeout")
132 assert.NoError(t, mock.ExpectationsWereMet())
133}
134
135func TestNewMultiLocker_SortsKeysLexicographically(t *testing.T) {
136 db, _ := redismock.NewClientMock()

Callers

nothing calls this directly

Calls 2

WaitLockMethod · 0.95
NewLockerFunction · 0.85

Tested by

no test coverage detected