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

Function TestLockReturnsNonContentionError

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

Source from the content-addressed store, hash-verified

139}
140
141func TestLockReturnsNonContentionError(t *testing.T) {
142 lockPath := filepath.Join(t.TempDir(), "no", "such", "dir", "test.lock")
143
144 _, _, err := flock.Lock(t.Context(), lockPath)
145 require.ErrorIs(t, err, os.ErrNotExist)
146}
147
148func TestLockTimesOutUnderContention(t *testing.T) {
149 lockPath := filepath.Join(t.TempDir(), "held.lock")

Callers

nothing calls this directly

Calls 2

LockFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected