(t *testing.T)
| 432 | } |
| 433 | |
| 434 | func TestClusterClient_LockWithTimeout(t *testing.T) { |
| 435 | cluster := newTestOlricCluster(t) |
| 436 | db := cluster.addMember(t) |
| 437 | |
| 438 | ctx := context.Background() |
| 439 | c, err := NewClusterClient([]string{db.name}) |
| 440 | require.NoError(t, err) |
| 441 | defer func() { |
| 442 | require.NoError(t, c.Close(ctx)) |
| 443 | }() |
| 444 | |
| 445 | dm, err := c.NewDMap("mydmap") |
| 446 | require.NoError(t, err) |
| 447 | |
| 448 | lx, err := dm.LockWithTimeout(ctx, "lock.foo.key", time.Hour, time.Second) |
| 449 | require.NoError(t, err) |
| 450 | |
| 451 | err = lx.Unlock(ctx) |
| 452 | require.NoError(t, err) |
| 453 | } |
| 454 | |
| 455 | func TestClusterClient_LockWithTimeout_ErrNoSuchLock(t *testing.T) { |
| 456 | cluster := newTestOlricCluster(t) |
nothing calls this directly
no test coverage detected