MCPcopy
hub / github.com/olric-data/olric / TestEmbeddedClient_DMap_Lock

Function TestEmbeddedClient_DMap_Lock

embedded_client_test.go:360–376  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

358}
359
360func TestEmbeddedClient_DMap_Lock(t *testing.T) {
361 cluster := newTestOlricCluster(t)
362 db := cluster.addMember(t)
363
364 e := db.NewEmbeddedClient()
365 dm, err := e.NewDMap("mydmap")
366 require.NoError(t, err)
367
368 ctx := context.Background()
369 key := "lock.key.test"
370
371 lx, err := dm.Lock(ctx, key, time.Second)
372 require.NoError(t, err)
373
374 err = lx.Unlock(ctx)
375 require.NoError(t, err)
376}
377
378func TestEmbeddedClient_DMap_Lock_ErrLockNotAcquired(t *testing.T) {
379 cluster := newTestOlricCluster(t)

Callers

nothing calls this directly

Calls 6

NewDMapMethod · 0.95
LockMethod · 0.95
newTestOlricClusterFunction · 0.85
addMemberMethod · 0.80
NewEmbeddedClientMethod · 0.80
UnlockMethod · 0.65

Tested by

no test coverage detected