(t *testing.T)
| 433 | } |
| 434 | |
| 435 | func TestEmbeddedClient_DMap_LockWithTimeout_Timeout(t *testing.T) { |
| 436 | cluster := newTestOlricCluster(t) |
| 437 | db := cluster.addMember(t) |
| 438 | |
| 439 | e := db.NewEmbeddedClient() |
| 440 | dm, err := e.NewDMap("mydmap") |
| 441 | require.NoError(t, err) |
| 442 | |
| 443 | ctx := context.Background() |
| 444 | key := "lock.key.test" |
| 445 | |
| 446 | lx, err := dm.LockWithTimeout(ctx, key, time.Millisecond, time.Second) |
| 447 | require.NoError(t, err) |
| 448 | |
| 449 | <-time.After(2 * time.Millisecond) |
| 450 | |
| 451 | err = lx.Unlock(ctx) |
| 452 | require.ErrorIs(t, err, ErrNoSuchLock) |
| 453 | } |
| 454 | |
| 455 | func TestEmbeddedClient_DMap_LockWithTimeout_ErrLockNotAcquired(t *testing.T) { |
| 456 | cluster := newTestOlricCluster(t) |
nothing calls this directly
no test coverage detected