(t *testing.T)
| 364 | } |
| 365 | |
| 366 | func TestClusterClient_Lock_Unlock(t *testing.T) { |
| 367 | cluster := newTestOlricCluster(t) |
| 368 | db := cluster.addMember(t) |
| 369 | |
| 370 | ctx := context.Background() |
| 371 | c, err := NewClusterClient([]string{db.name}) |
| 372 | require.NoError(t, err) |
| 373 | defer func() { |
| 374 | require.NoError(t, c.Close(ctx)) |
| 375 | }() |
| 376 | |
| 377 | dm, err := c.NewDMap("mydmap") |
| 378 | require.NoError(t, err) |
| 379 | |
| 380 | lx, err := dm.Lock(ctx, "lock.foo.key", time.Second) |
| 381 | require.NoError(t, err) |
| 382 | |
| 383 | err = lx.Unlock(ctx) |
| 384 | require.NoError(t, err) |
| 385 | } |
| 386 | |
| 387 | func TestClusterClient_Lock_Lease(t *testing.T) { |
| 388 | cluster := newTestOlricCluster(t) |
nothing calls this directly
no test coverage detected