MCPcopy Create free account
hub / github.com/cli/cli / TestLockAcquiresWhenFree

Function TestLockAcquiresWhenFree

internal/flock/flock_test.go:103–110  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

101}
102
103func TestLockAcquiresWhenFree(t *testing.T) {
104 lockPath := filepath.Join(t.TempDir(), "free.lock")
105
106 f, unlock, err := flock.Lock(t.Context(), lockPath)
107 require.NoError(t, err)
108 require.NotNil(t, f)
109 unlock()
110}
111
112func TestLockBlocksUntilUnlocked(t *testing.T) {
113 lockPath := filepath.Join(t.TempDir(), "contended.lock")

Callers

nothing calls this directly

Calls 2

LockFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected