MCPcopy Create free account
hub / github.com/Shopify/goose / Test_lockMap_WaitOrLock

Function Test_lockMap_WaitOrLock

lockmap/map_test.go:101–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func Test_lockMap_WaitOrLock(t *testing.T) {
102 m := newMap(sweepInterval)
103
104 promise, gotLock := m.WaitOrLock(1, ttl)
105 assert.True(t, gotLock)
106
107 stored, gotLock := m.WaitOrLock(1, ttl)
108 assert.False(t, gotLock)
109 assert.Equal(t, promise, stored)
110
111 assertNotResolved(promise)
112}
113
114func Test_lockMap_sweep(t *testing.T) {
115 sweep := ttl * 3 / 2

Callers

nothing calls this directly

Calls 3

newMapFunction · 0.85
assertNotResolvedFunction · 0.85
WaitOrLockMethod · 0.65

Tested by

no test coverage detected